win10+cuda10.1+cuDNN v7.5.0+Tensorflow(GPU)安装)

win10+cuda10.1+cuDNN v7.5.0+Tensorflow(GPU)安装)

先装Tensorflow-gpu
我是小白由于没装过tensorflow,Tensorflow-gpu 1.12.0是在买显卡之前用conda安装的,用的是anacond (python3.6版),利用清华镜像一次安装成功。由于没有装novida显卡,显卡是i3-8100自带的集成显卡,没办法计算 。于是手痒就虚拟了个另外环境,装的是tensorflow-CpU版,可以用keras调用成功。
为了试用tensorflow-GPU版就在在网上淘了个铭瑄的GT1030显卡(鲁大师4.3万分比GTX 750TI少了1万分),由于计算量不大、学习用,没买好显卡。心里还犹豫,这款显卡不在英伟达官网的cuda算力表内,不知能不能进行GPU计算。结果买回后,用测试软件检测是DDr5的是正品,马上装驱动,在官网下的驱动419.17-desktop-win10-64bit-international-whql以及cuda_10.1.105_418.96_win10。之后英伟达给装了一堆乱七八糟的东西,也不懂。

装cudnn
后来发现还要装cudnn,于是从官网下载与cuda_10.1匹配的cudnn v7.5.0.56(解压出cudnn-10.1-windows10-x64-v7.5.0.56文件夹)
将cudnn文件夹下bin和inclue、lib文件夹下的文件考入C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1下的相应文件夹内。以上参考https://blog.csdn.net/weixin_36368407/article/details/54177380。

然后用jupyter notebook 试运行下面代码
import tensorflow as tf
import numpy as np
hello=tf.constant(‘hhkk’)
sess=tf.Session()
print (sess.run(hello))
运行好久,出来结果:b’hhkk’

后台出来一堆东西:
[I 21:12:46.296 NotebookApp] Creating new notebook in
[W 21:12:51.135 NotebookApp] 404 GET /nbextensions/widgets/notebook/js/extension.js?v=20190305211231 (::1) 25.93ms referer=http://localhost:8888/notebooks/Untitled2.ipynb?kernel_name=python3
[I 21:12:51.696 NotebookApp] Kernel started: 68e36a18-fa0c-4e2e-b95a-2c01113c16db
[I 21:12:53.032 NotebookApp] Adapting to protocol v5.1 for kernel 68e36a18-fa0c-4e2e-b95a-2c01113c16db
2019-03-05 21:14:18.076789: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2
2019-03-05 21:14:18.705275: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1432] Found device 0 with properties:
name: GeForce GT 1030 major: 6 minor: 1 memoryClockRate(GHz): 1.468
pciBusID: 0000:01:00.0
totalMemory: 2.00GiB freeMemory: 1.62GiB
2
019-03-05 21:14:18.711904: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1511] Adding visible gpu devices: 0
2019-03-05 21:14:19.337644: I tensorflow/core/common_runtime/gpu/gpu_device.cc:982] Device interconnect StreamExecutor with strength 1 edge matrix:
2019-03-05 21:14:19.341335: I tensorflow/core/common_runtime/gpu/gpu_device.cc:988] 0
2019-03-05 21:14:19.343360: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1001] 0: N
2019-03-05 21:14:19.345430: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 1369 MB memory) -> physical GPU (device: 0, name: GeForce GT 1030, pci bus id: 0000:01:00.0, compute capability: 6.1)
想不到显卡GT1030也有6.1的算力,可惜计算单元才384个,比1060少好多。到这步应该是装好可以用了。2019-3-5

在这里插入图片描述

没有更多推荐了,返回首页