下载地址: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