无论是Ubuntu或者win10,安装TensorFlow时总会遇到一点问题,特此记住安装流程!
一般用pip install tensorflow或者conda install tensorflow很难成功安装上,成功安装流程如下:
1.打开anaconda prompt或者命令行窗口,最好用前者,创建TensorFlow环境
conda create -n tensorflow python=3.6 或conda create -n tensorflow python
(可以根据自己的python版本自行创建,或者直接省略版本)
2.激活TensorFlow环境
activate tensorflow (windows)
source activate tensorflow (ubuntu)
3.安装tensorflow-gpu版本
conda install tensorflow
或conda install --channel https://conda.anaconda.org/anaconda tensorflow(从anaconda官网安装)
或conda install --channel
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free tensorflow (从清华镜像中安装)
(一般都能顺利安装上,如果不行,再尝试其他办法!)
4.关闭tensorflow环境
source deactivate tensorflow