Make sure the device specification refers to a valid device

来源:互联网 发布:软件下载中心哪个好 编辑:程序博客网 时间:2024/06/06 10:40


开始调用

with tf.Session() as sess,tf.device('/gpu:0'):
时报错:


InvalidArgumentError (see above for traceback): Cannot assign a device for operation 'init': Operation was explicitly assigned to /device:GPU:0 but available devices are [ /job:localhost/replica:0/task:0/cpu:0 ]. Make sure the device specification refers to a valid device.


解决方法:pip uninstall tensorflow


pip install tensorflow-gpu


下载cudnn v6,把include lib bin三个目录拷贝到下面目录:

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\cuda

后来就能用了

阅读全文
0 0
原创粉丝点击