train_image_classifier.py:Cannot assign a device for operation CifarNet/conv1/Conv2D: node CifarNet

出错内容如下:

Errors may have originated from an input operation.
Input Source operations connected to node CifarNet/conv1/Conv2D:
 fifo_queue_Dequeue (defined at train_image_classifier.py:487)
 CifarNet/conv1/weights/read (defined at /home/zhihao/.local/lib/python3.7/site-packages/tf_slim/ops/variables.py:256)
I1219 22:12:23.329565 139732271825280 coordinator.py:224] Error reported to Coordinator: <class 'tensorflow.python.framework.errors_impl.InvalidArgumentError'
>, Cannot assign a device for operation CifarNet/conv1/Conv2D: node CifarNet/conv1/Conv2D (defined at /tmp/tmpoxb0c7yp.py:12) was explicitly assigned to /devi
ce: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 ]. Make sure the device sp
ecification refers to a valid device. The requested device appears to be a GPU, but CUDA is not enabled.
         [[CifarNet/conv1/Conv2D]]

这个原因是因为在train_image_classifier.py中使用了GPU的代码,此时你的电脑上没有CUDA,因为TensorFlowGPU方面的代码需求CUDALIB库,如果需要可以去互联网上装它,如果不需要可以打开train_image_classifier.py搜索”clone_on_cpu“,将Flash改为True就可以了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

17岁boy想当攻城狮

感谢打赏

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值