【发布时间】:2018-06-21 20:06:42
【问题描述】:
我一直在尝试安装 tensorflow-gpu,但在使用 CUDA 时遇到了很多麻烦。首先,CUDA 安装程序中的 Visual Studio 集成总是给我一个错误,但如果我在 CUDA 安装期间遗漏了 Visual Studio 集成,则安装工作正常。 使用 tensorflow-gpu 是否必须集成 Studio?
然后我为 CUDA 9.0 安装了所有 3 个补丁,并将 Cudnn 文件放在文件夹中。 接下来,我去了我的环境变量并添加了这个路径(C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0)
因此,当我打开命令提示符并导入 tensorflow 时,在所有有关此主题的教程中,我都看到了一些关于成功加载内容的行?我没有这些。
所以我运行这个小代码
import tensorflow as tf
sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
我得到了这个答案
"C:\Program Files\Python35\python.exe" C:/Users/Felix/Documents/Uni/Semesterarbeit/doesitwork.py
2018-06-21 13:41:41.187933: I T:\src\github\tensorflow\tensorflow\core\platform\cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
2018-06-21 13:41:41.748188: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:1356] Found device 0 with properties:
name: GeForce GTX 1070 major: 6 minor: 1 memoryClockRate(GHz): 1.7085
pciBusID: 0000:21:00.0
totalMemory: 8.00GiB freeMemory: 6.63GiB
2018-06-21 13:41:41.748527: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:1435] Adding visible gpu devices: 0
2018-06-21 13:43:44.853239: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:923] Device interconnect StreamExecutor with strength 1 edge matrix:
2018-06-21 13:43:44.853436: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:929] 0
2018-06-21 13:43:44.853564: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:942] 0: N
2018-06-21 13:43:44.853860: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:1053] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 6401 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1070, pci bus id: 0000:21:00.0, compute capability: 6.1)
Device mapping:
2018-06-21 13:43:45.164653: I T:\src\github\tensorflow\tensorflow\core\common_runtime\direct_session.cc:284] Device mapping:
/job:localhost/replica:0/task:0/device:GPU:0 -> device: 0, name: GeForce GTX 1070, pci bus id: 0000:21:00.0, compute capability: 6.1
/job:localhost/replica:0/task:0/device:GPU:0 -> device: 0, name: GeForce GTX 1070, pci bus id: 0000:21:00.0, compute capability: 6.1
Process finished with exit code 0
这是它应该的样子吗? 期待答案 干杯, 费利克斯
【问题讨论】:
标签: tensorflow