进入官网Anaconda官网 选择64位的版本下载,可以复制链接到迅雷下载,下载快一些。 或者清华大学tensorflow镜像
bash Anaconda3-2020.11-Linux-x86_64
执行以下步骤 (1)是否确定安装,输入yes (2)出现more, 按空格继续 (3)Do you accept the license terms? 输入yes (4)Anaconda3 will now be installed into this location: /home/mgege007/anaconda3确定安装位置,按enter继续 (5)Do you wish the installer to initialize Anaconda3 by running conda init? 输入Yes,然后就安装好了。
1.2 配置环境变量sudo vim /etc/profile
在文件的最后加上,这里注意,这里的路径对应第(4)步中你安装的时候选择的路径,我这里是/hom/mgge007/anaconda3
#Anaconda
export PATH=$PATH:/home/mgege007/anaconda3/bin
测试是否安装好,输入conda,显示如下
conda
前提是安装了anaconda,因为anaconda是自带最新的python和pip的。所以以下步骤是基于上面的ananconda安装成功后,能使用的。
pip install tensorflow-gpu==2.3 -i https://pypi.douban.com/simple/
等待显示如下表示安装完毕
查看tensorflow版本
python3 import tensorflow as tf print(tf.version)