TensorFlow(一)——conda版安装

1.安装anaconda:

https://repo.continuum.io/archive/index.html选择相应版本,我选择的是最新的版本5.2.0:

wget https://repo.continuum.io/archive/Anaconda3-5.2.0-Linux-x86_64.sh

之后直接进行安装:

bash Anaconda3-5.2.0-Linux-x86_64.sh

之后按照步骤进行就可以,最后需要确认添加路径到.bashrc。(有时候不会自动添加,则需要手动添加)

手动添加:

gedit ~/.bashrc

在最后一行添加:

export PATH=~/anaconda3/bin:$PATH

无论手动还是自动都要重启环境变量:

source ~/.bashrc

就可以了,可以查看python版本是否已经变成anaconda了。

2.安装TensorFlow

参考网站:https://github.com/conda-forge/tensorflow-feedstock

只有CPU版本可以安装:

conda config --add channels conda-forge

conda install tensorflow

这时候进入python,import tensorflow 成功就是安装成功了。

猜你喜欢

转载自blog.csdn.net/MRxjh/article/details/82502284