一段时间以来,我一直在尝试安装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
这是应该的样子吗? 期待一个答案 干杯, 费利克斯
答案 0 :(得分:1)
看看日志的最后一行。
'job:localhost / replica:0 / task:0 / device:GPU:0->设备:0,名称:GeForce GTX 1070,pci总线ID:0000:21:00.0,计算能力:6.1'>