I have tensorflow-gpu 1.2.1 and keras on ubuntu 16.04.
I am not able to perform:
from kears.utils import multi_gpu_model
Has anyone had success with multi_gpu_model as described in their documentation's FAQ section?
I have a 4 GPU machine with 4 GeForce GTX 1080 Ti cards and want to use all of them.
Here's the error I get:
import keras.utils.multi_gpu_model
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-7-0174878249b1> in <module>()
----> 1 import keras.utils.multi_gpu_model
2
ModuleNotFoundError: No module named 'keras.utils.multi_gpu_model'
I can import keras and keras.utils successfully.
pip uninstall keras
pip install keras==2.2.4
this helped me ... working on keras hrnetv2
for Tensorflow 2.7.0 this works:
from tensorflow.python.keras.utils.multi_gpu_utils import multi_gpu_model
This function was added on October 11, and there have been no Keras releases that include it. Currently the last Keras release is 2.0.8 released on Aug 25, 2017.
Your only options are to wait until a release is made, or to use a Keras version directly from git master.
To close this issue: I installed the latest version of Keras from github and got the multi_gpu_model module working as expected.
pip install git+git://github.com/fchollet/keras.git --upgrade
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With