python之用Anaconda安装Tensorflow

本文详细记录了在Win10环境下,使用Anaconda4.6.8与Python3.6.8,安装CUDA10.0、cuDNN7.4.1以及TensorFlow-gpu1.13.1的过程。包括驱动更新、自定义安装CUDA、覆盖cuDNN文件、环境配置及验证步骤,特别注意CUDA与cuDNN版本匹配的重要性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


安装时间:2019-03-14

显卡: 1066

环境: win10 + anaconda 4.6.8 + python 3.6.8 + CUDA 10.0 + cuDNN 7.3.1 + Tensorflow-gpu 1.13.1      3-14

环境: win10 + anaconda 4.6.8 + python 3.6.8 + CUDA 10.0 + cuDNN 7.4.1 + Tensorflow-gpu 1.13.1       更新时间3-17                  安装openCV 4.0.1   更新时间3-22

 

下载网址:

CUDA : https://developer.nvidia.com/cuda-toolkit-archive

cuDNN历史版:  https://developer.nvidia.com/rdp/cudnn-archive

cuDNN最新版:  https://developer.nvidia.com/rdp/cudnn-download

安装步骤及需要注意的地方:

1.安装最新的显卡驱动;

2.安装CUDA是,注意要用自定义安装,并只勾选CUDA组件,其余都去掉(特别是最后一个会重新安装老版本的显卡驱动)

3.解压cuDNN,覆盖到Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0

4.打开CMD,输入 nvcc -V    确认CUDA版本

5.输入conda creat --name mytf python=3.6    //建立一个命名为mytf的环境,可以自定义

6.输入activate mytf    //激活自定义环境,并进入

7.输入pip install tensorflow-gpu    //安装TF

8.验证环节参考其他博客

 

采坑史:

用了最新的CUDA 10.1 + cuDNN 7.5.0 , 失败。 2019-03-13

 

 

更新:

2019-03-17报了这么一个错,现象为显存爆炸。。根据推荐安装了 cuDNN 7.4.1,可以正常运行

2019-03-17 19:51:42.004078: E tensorflow/stream_executor/cuda/cuda_dnn.cc:324] Loaded runtime CuDNN library: 7.3.0 but source was compiled with: 7.4.1.  CuDNN library major and minor version needs to match or have higher minor version in case of CuDNN 7.0 or later version. If using a binary install, upgrade your CuDNN library.  If building from sources, make sure the library loaded at runtime is compatible with the version specified during compile configuration.

tensorflow.python.framework.errors_impl.UnknownError: Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above.
     [[{{node inference/Conv2D}}]]

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值