1. 让pip使用国内镜像源
国内源:
- 清华:https://pypi.tuna.tsinghua.edu.cn/simple
- 阿里云:http://mirrors.aliyun.com/pypi/simple/
- 中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
- 豆瓣:http://pypi.douban.com/simple/
接下来以清华源为例进行设置
临时使用
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package
注意,simple 不能少, 是 https 而不是 http
设为默认
升级 pip 到最新的版本 (>=10.0.0) 后进行配置:
pip install pip -U
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
如果到 pip 默认源的网络连接较差,临时使用本镜像站来升级 pip:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pip -U
2. tensorflow cuDNN CUDA版本对应关系
- windows
- linux
这些信息可以在官方安装教程找到。
3. ImportError: DLL load failed: 动态链接库(DLL)初始化例程失败
原因是因为从tensorflow==1.6开始,tensorflow使用了AVX指令,但是我的CPU(Inter® Xeon® CPU E5620)不支持AVX指令集(可以通过CPU-Z查看)。
解决方法有两个,一个是安装tensorflow==1.6之前的版本,另外一个是下载源码自行编译。
4. pip is configured with locations that require TLS/SSL, however the ssl module in python is not available
由于某些原因,anaconda中的python3.7的SSL模块不可用,解决方法是将Anaconda路径下的Library\bin 加入到Path变量中。
5. Loaded runtime CuDNN library: 7500 (compatibility version 7500) but source was compiled with 7003 (compatibility version 7000).
环境如下:
- tensorflow-gpu==1.5
- cuDNN==7.5
运行时出现上述错误,原因是tensorlfow与cuDNN版本不匹配,使用cuDNN==7.0就可以解决该问题。