下載地址:https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/
tensorflow 鏡像地址:https://mirror.tuna.tsinghua.edu.cn/help/tensorflow/
1. 在Ubuntu上安裝anaconda的步驟:
參考內網AI
2.在ubuntu上卸載anaconda的步驟 :
(一)刪除整個anaconda目錄:
由於Anaconda的安裝文件都包含在一個目錄中,所以直接將該目錄刪除即可。到包含整個anaconda目錄的文件夾下,刪除整個Anaconda目錄:
rm -rf anaconda文件夾名
(二)建議清理下.bashrc中的Anaconda路徑:
1).到根目錄下,打開終端並輸入:
sudo gedit ~/.bashrc
2).在.bashrc文件末尾用#號註釋掉之前添加的路徑(或直接刪除):
#export PATH=/home/lq/anaconda3/bin:$PATH
保存並關閉文件
3).使其立即生效,在終端執行:
source ~/.bashrc
4).關閉終端,然後再重啓一個新的終端,這一步很重要,不然在原終端上還是綁定有anaconda.
原文:https://blog.csdn.net/qq_22474567/article/details/54984257
3.基於anaconda安裝tensorflow
1).下載tensorflow鏡像(推薦去清華鏡像下載)
https://mirror.tuna.tsinghua.edu.cn/help/tensorflow/
下載.e.g.
https://mirrors.tuna.tsinghua.edu.cn/tensorflow/linux/cpu/*-linux_x86_64.whl
2).安裝tensorflow
(1).創建conda環境
conda create -n tensorflow-cpu python=3.6.3(自己電腦版本)
(2)激活環境:
source activate tensorflow-cpu
(3)進入tensorflow-cpu環境安裝tensorflow
pip install --ignore-installed --upgrade tensorflow-*-linux_x86_64.whl
(4).測試是否安裝成功
import tensorflow as tf
(5).退出該環境
source deactivate
(6).移除tf環境
$ conda remove -n tensorflow-cpu --all
Windows安裝tensorflow
您可以直接使用pip安裝tensorflow,只需一行代碼就安裝好了。
cpu版:
pip3 install --upgrade tensorflow
gpu版:
pip3 install --upgrade tensorflow-gpu