>  Q&A  >  본문

python - tensorflow 在windows 下怎么使用gpu ?

  1. 相关环境

  1. 代码

import tensorflow as tf

with tf.Session() as sess:
  with tf.device("/gpu:0"):
    matrix1 = tf.constant([[3., 3.]])
    matrix2 = tf.constant([[2.],[2.]])
    product = tf.matmul(matrix1, matrix2)
    result = sess.run([product])
    print(result)
  1. 错误信息

InvalidArgumentError (see above for traceback): Cannot assign a device to node 'MatMul': Could not satisfy explicit device specification '/device:GPU:0' because no devices matching that specification are registered in this process; available devices: /job:localhost/replica:0/task:0/cpu:0
         [[Node: MatMul = MatMul[T=DT_FLOAT, transpose_a=false, transpose_b=false, _device="/device:GPU:0"](Const, Const_1)]]

2017-01-08 tensorflow 在windows 下使用gpu中文教程

迷茫迷茫2711일 전865

모든 응답(1)나는 대답할 것이다

  • 黄舟

    黄舟2017-04-18 10:14:20

    이전 버전은 docker에서만 실행 가능하므로 GPU를 사용할 수 없습니다. 이제 새 버전에서는 Windows를 지원한다고 명시되어 있습니다. 올바르게 설치하면 문제가 없습니다.

    Python3.5, TensorFlow, Cuda 툴킷 8.0, cuDNN

    자세한 내용은 http://www.netinstructions.co...

    회신하다
    0
  • 취소회신하다