繁体   English   中英

我无法在 anaconda python3.6 和 spyder 上成功运行 tensorflow-gpu

[英]I can not successfully run tensorflow-gpu on anaconda python3.6 and spyder

当我尝试运行以下代码时,TensorFlow-GPU 出现问题

from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())

它产生这个错误:

同样的问题发生在这里 .

我的CUDA版本是10.2,cudnn版本是7.6.5,anaconda navigator上显示的TensorFlow-GPU版本是2.0.0。

(我通常在导航器上安装包)

有人可以帮助我吗?

谢谢...

tensorflow/streams_executor...之前的字母I表示您正在收到 INFO 级别的日志消息,而 Spyder 将此信息消息误认为是错误。 收到此消息是可以的,但是,您可以通过运行以下代码对 GPU 执行其他检查:

import tensorflow as tf
tf.debugging.set_log_device_placement(True)
print("Num GPUs Available: ", len(tf.config.experimental.list_physical_devices('GPU')))
# Create some tensors
a = tf.constant([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]])
b = tf.constant([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]])
c = tf.matmul(a, b)
print(c)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM