使用TensorFlow训练图像时出现GPU错误



当我在容器tensorflow/tensorflow:最新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信息:nvidia smi2018年11月26日星期一07:48:59
+-----------------------------------------------------------------------------+|NVIDIA-SMI 410.72驱动程序版本:410.72 CUDA版本:10.0||-------------------------------+----------------------+----------------------+|GPU名称Persistence-M |总线Id Disp.A |易失性Uncorr。ECC||风扇温度性能Pwr:使用率/Cap |内存使用率| GPU Util Compute M||===============================+======================+======================||0 GeForce GT 630关闭|00000000:01:00.0不适用|不适用||25%47C P0 N/A/N/A|0MiB/1998MiB|N/A默认|+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+|进程:GPU内存||GPU PID类型进程名称用法||=============================================================================||不支持0|+-----------------------------------------------------------------------------+

Tensorflow似乎没有检测到任何可用的gpu,而是将操作映射到gpu:0。首先尝试这个:

from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())

你会得到可用的设备。有/device:GPU:0吗?

最新更新