如何使用一个GPU
To call `multi_gpu_model` with `gpus=2`, we expect the following devices to be available: ['/cpu:0', '/gpu:0', '/gpu:1']. However this machine only has: ['/cpu:0']. Try reducing `gpus
ValueError: To call `multi_gpu_model` with `gpus=2`, we expect the following devices to be available: ['/cpu:0', '/gpu:0', '/gpu:1']. However this machine only has: ['/cpu:0']. Try reducing `gpus`.
4
It looks like Keras only sees one of the GPUs.
Make sure that all 4 GPUs are accessible, you can use device_lib with TensorFlow.
from tensorflow.python.client import device_lib
def get_available_gpus():
local_device_protos = device_lib.list_local_devices()
return [x.name for x in local_device_protos if x.device_type == 'GPU']
You might need to manually install or update GPU drivers on your instance. Consult here.
https://stackoverflow.com/questions/52950449/valueerror-when-using-multi-gpu-model-in-keras
解决Keras多GPU配置问题
本文探讨了在使用Keras框架尝试配置多GPU时遇到的常见错误:ValueError。详细解析了错误信息,提供了检查GPU可用性的Python代码,并指导读者如何通过更新GPU驱动来解决问题,确保所有GPU都能被正确识别。
1912

被折叠的 条评论
为什么被折叠?



