当我在容器tensorflow / tensorflow:latest-gpu中运行tensorflow图像训练作业时,它不起作用。
错误消息:
Cannot assign a device for operation InceptionV3/InceptionV3/Conv2d_1a_3x3/Conv2D: Operation was explicitly assigned to /device:GPU:0 but available devices are [ /job:localhost/replica:0/task:0/device:CPU:0, /job:localhost/replica:0/task:0/device:XLA_CPU:0, /job:localhost/replica:0/task:0/device:XLA_GPU:0 ]. Make sure the device specification refers to a valid device.
[[node InceptionV3/InceptionV3/Conv2d_1a_3x3/Conv2D (defined at /usr/local/lib/python2.7/dist-packages/tensorflow/contrib/layers/python/layers/layers.py:1057) = Conv2D[T=DT_FLOAT, data_format="NHWC", dilations=[1, 1, 1, 1], padding="VALID", strides=[1, 2, 2, 1], use_cudnn_on_gpu=true, _device="/device:GPU:0"](fifo_queue_Dequeue, InceptionV3/Conv2d_1a_3x3/weights/read)]]
GPU信息:
英伟达
2018年11月26日星期一07:48:59
+ ------------------------------------------------- ---------------------------- +
| NVIDIA-SMI 410.72驱动程序版本:410.72 CUDA版本:10.0 |
| ------------------------------- + ----------------- ----- + ---------------------- +
| GPU名称持久性-M |总线编号Disp.A |挥发性不佳。 ECC |
|风扇温度性能:用法/上限|内存使用| GPU实用计算M。
| ============================== + ================= ===== + ==================== |
| 0 GeForce GT 630关闭| 00000000:01:00.0 N / A | N / A |
| 25%47C P0不适用/不适用| 0MiB / 1998MiB | N / A默认|
+ ------------------------------- + ----------------- ----- + ---------------------- +
+ ---------------------------------------------- ------------------------------- + |进程:GPU内存| | GPU PID类型进程名称用法| | ================================================= ========================== | | 0不支持| + ------------------------------------------------- ---------------------------- +
答案 0 :(得分:0)
您Tensorflow似乎没有检测到任何可用的gpu,而是将操作映射到GPU:0。首先尝试:
from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())
您将获得可用的设备。是否有/device:GPU:0
?