tensorflow小白---Operation was explicitly assigned to /device:GPU:1 but available devices are [ /job:l
2017-11-25 14:42
651 查看
1、
10.0
运行后不报错
然后再运行
2
运行不报错
再运行1
报错
操作挂载到了gpu:1上,但是可用设备只有cpu:0
根据提示执行
4 不报错
再执行1还是报错
解决方法,不关闭当前页面而是shutdown当前的jupter,再重新启动jupyter即可解决
import tensorflow as tf c1=tf.constant(5.0) c2=tf.constant(2.0) c=c1*c2 sess=tf.Session() result=sess.run(c) print (result) sess.close()
10.0
运行后不报错
然后再运行
2
with tf.Session() as sess: with tf.device("/gpu:1"): matrix1 = tf.constant([[3., 3.]]) matrix2 = tf.constant([[2.],[2.]]) product = tf.matmul(matrix1, matrix2)
运行不报错
再运行1
import tensorflow as tf c1=tf.constant(5.0) c2=tf.constant(2.0) c=c1*c2 sess=tf.Session() result=sess.run(c) print (result) sess.close()
报错
操作挂载到了gpu:1上,但是可用设备只有cpu:0
InvalidArgumentError: Cannot assign a device for operation 'MatMul': Operation was explicitly assigned to /device:GPU:1 but available devices are [ /job:localhost/replica:0/task:0/device:CPU:0 ]. Make sure the device specification refers to a valid device. [[Node: MatMul = MatMul[T=DT_FLOAT, transpose_a=false, transpose_b=false, _device="/device:GPU:1"](Const_4, Const_5)]]
根据提示执行
4 不报错
with tf.Session() as sess: with tf.device("/cpu:0"): matrix1 = tf.constant([[3., 3.]]) matrix2 = tf.constant([[2.],[2.]]) product = tf.matmul(matrix1, matrix2)
再执行1还是报错
InvalidArgumentError: Cannot assign a device for operation 'MatMul': Operation was explicitly assigned to /device:GPU:1 but available devices are [ /job:localhost/replica:0/task:0/device:CPU:0 ]. Make sure the device specification refers to a valid device. [[Node: MatMul = MatMul[T=DT_FLOAT, transpose_a=false, transpose_b=false, _device="/device:GPU:1"](Const_4, Const_5)]]
解决方法,不关闭当前页面而是shutdown当前的jupter,再重新启动jupyter即可解决
相关文章推荐
- Operation was explicitly assigned to /device:GPU:0 but available devices are [ /job:localhost/repli
- Operation was explicitly assigned to /job:ps/task:0/device:CPU:0 but available devices are [ /job:localhost/replica:0/task:0/cpu:0 ]
- device:GPU:0 but available devices are [ /job:localhost/replica:0/task:0/dev
- tensorflow-gpu bug:The TensorFlow library wasn't compiled to use SSE instructions, but these are
- No provisioned iOS devices are available with a compatible iOS version. Connect an iOS device with a
- UserWarning: No parser was explicitly specified, so I'm using the best available HTML parser
- tensorflow使用遇到的问题The TensorFlow library wasn't compiled to use SSE instructions, but these are avail
- tensorflow出现一大串 The TensorFlow library wasn't compiled to use SSE instructions, but these are ...
- The TensorFlow library wasn't compiled to use SSE instructions, but these are available on your.....
- AndroidStudio3.0 注解报错Annotation processors must be explicitly declared now. The following dependencies on the compile classpath are found to contain annotation processor.
- TensorFlow wasn't compiled to use SSE (etc.) instructions, but these are available
- No provisioned iOS devices are available with a compatible iOS version. Connect an iOS device with a
- TensorFlow问题“The TensorFlow library wasn't compiled to use SSE instructions, but these are available on your machine and could speed up CPU computations.”
- TensorFlow问题:The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
- Computed property "isLoading" was assigned to but it has no setter.
- Xcode cannot run using the selected device No supported iOS devices are available. Connect an iOS de
- AS使用lombok注解报错:Annotation processors must be explicitly declared now. The following dependencies on the compile classpath are found to contain annotation processor.
- The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available...
- The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available...
- The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your..