Skip to content Skip to sidebar Skip to footer

Is There An Issue Using Tf.keras.utils.multi_gpu_model With A Model Class Api?

I am trying to train a convolutional autoencoder using tensorflow.keras. Here, I have a Model Class API (I think that is what it's called) that works using a single GPU (not implem

Solution 1:

No, the problem is not the usage of Model() API.

The problem is that there are some issues with the tensorflow.keras and plain keras compatiblity and my intuition tells me (according to the error you posted) that there is a problem with the multi_gpu function, in that it doesn't correctly detect the available devices.

Not surprised, since the official TensorFlow documentation states it clearly that:

Warning: THIS FUNCTION IS DEPRECATED. It will be removed after 2020-04-01. Instructions for updating: Use tf.distribute.MirroredStrategy instead.

Someone here had a similar problem: { AttributeError: module 'tensorflow_core._api.v2.config' has no attribute 'experimental_list_devices' } how can i solve this error?

My strong recommendation is to switch to MirroredStrategy() if you want to train the model on multi_gpus. Not only do you avoid such problems but it's also the recommended way in the foreseeable future.

Post a Comment for "Is There An Issue Using Tf.keras.utils.multi_gpu_model With A Model Class Api?"