【发布时间】:2019-07-20 22:18:52
【问题描述】:
就这样吧:我想在 AWS 上使用 TensorFlow 和 GPU - p2.xlarge 计划。不幸的是,一定是出了什么问题,我继续得到:
InvalidArgumentError (see above for traceback): Cannot assign a device to node 'Variable_1': 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
我检查了 CUDA 和 cuDNN:
nvcc -V
cat /usr/local/cuda/include/cudnn.h
分别得到 8.0 和 5.1。
我这样调用gpu:
with tf.device('/gpu:0'):
a = tf.Variable(tf.truncated_normal([100, 100]))
b = tf.Variable(tf.truncated_normal([100, 1000]))
with tf.Session() as sess:
sess.run(tf.matmul(a,b))
如有必要,很乐意发布更多详细信息 - 还不知道什么会有用。
【问题讨论】:
-
可能没有正确安装 CUDA。在命令提示符下运行
nvidia-smi的结果是什么? -
贴出tensorflow的启动日志。
-
您需要安装 NVIDIA 驱动程序并运行 CUDA 8.0 安装程序。您可以在此处了解如何操作:stackoverflow.com/questions/42422065/…
标签: amazon-web-services tensorflow