Tensorflow 2.0rc Not Detecting Gpus
TF2 is currently not detecting GPUs, I migrated from TF1.14 where using tf.keras.utils.multi_gpu_model(model=model, gpus=2) is now returning an error ValueError: To call `multi_
Solution 1:
I would suggest you to-
Please first check your Cuda version. Make sure it is 10.0.
If that is 10.0, then check your TF version if it is for GPU or not.
Check if TF can access the GPUs using the command
value = tf.test.is_gpu_available(
cuda_only=False,
min_cuda_compute_capability=None
)
print ('***If TF can access GPU: ***\n\n',value) # MUST RETURN True IF IT CAN!!
- I assume first 2 points are already taken care of by you. If TF can also access your GPUs then, as you can see in your
Value error
, it has names of GPUs actually. I can not say abouttf.keras.utils.multi_gpu_model()
function because I did not use it in TF. But I would suggest you to usewith tf.device('/gpu:0'):
. Inside this you call yourmodel
or define the model. - If point 4 also doesn't work, then just add following lines
import osos.environ["CUDA_VISIBLE_DEVICES"] = "0,1,2,3" # 0,1,2,3 are number of GPUs
at the top of your file and remove with tf.device('/gpu:0')
Solution 2:
CUDA should be the version 10.0, not 10.1
Post a Comment for "Tensorflow 2.0rc Not Detecting Gpus"