tensorflow快速安装国内镜像

直接安装tensorflow可以使用pip install tensorflow命令,但是速度非常慢。如果指定国内镜像会非常快。
以安装cpu版本为例:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow

安装几分钟之后就显示成功了,但是高兴的太早了。
验证代码:

import tensorflow as tf
print(tf.version)

发现报错:
ImportError: DLL load failed with error code -1073741795

百度了一下,基本断定是版本的问题。
我的版本:
ptyhon 3.5.1
anaconda 4.1.0
给我安装的tensorflow是1.13.0
我估计是太新了,所以先卸载tensorflow:
pip uninstall tensorflow

然后重新安装并且指定版本:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow==1.5.0
安装成功后,再次验证:

import tensorflow as tf
print(tf.version)

成功了!
安装个环境好麻烦~

猜你喜欢

转载自blog.csdn.net/qq_17854471/article/details/89299311