最近要用到深度学习算法,在搭建tensorflow环境时,遇到了很多问题。最后把完整的搭建环境放在这里。
1 下载Anaconda
这个网上教程很多
2 新建环境
在anaconda中在python3.6下新建一个环境tensorflow,然后进入这个环境。
3 下载镜像设置
因为清华镜像已经停了,所以我们要恢复到默认值
查看镜像信息
conda config --show channels
如果是清华镜像,就恢复到默认值
conda config --remove-key channels
如果显示下面这样说明恢复到默认值了
conda config --show channels
channels:
-
defaults
4 下载tensorflow
下载cpu版本的
pip install tensorflow-cpu -i https://pypi.douban.com/simple
5 下载安装VC_redist.x64.exe
下面是下载链接
https://support.microsoft.com/zh-cn/help/2977003/the-latest-supported-visual-c-downloads