I’m new to ML/tensorflow. Recently, TensorFlow released the new version 2.14.x with pip install tensorflow[and-cuda]. The below codes are not working after installing this package.
Anyone help me to provide the solution?
tf.ConfigProto() Api and tf.session are used in TF 1.x and are deprecated to use in TF 2.x. This is the reason these api are not working in TF 2.x.
You can use below code in TF 2.x for the same:
#To list all gpus
gpus = tf.config.list_physical_devices('GPU')
# Restrict TensorFlow to only use the first GPU
Please refer to the link to have fine grained control of GPU using TensorFlow.