在Anaconda3下使⽤清华镜像源安装TensorFlow(CPU版)
1、打开AnacondaPrompt
2、搭建TensorFlow的环境:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/conda config --set show_channel_urls yesconda create -n tensorflow python=3.5
3、在⽤户⽬录下找到⽂件 .condarc
环境搭建完成:
4、安装(CPU)版的TensorFlow:
// 启动TensorFlow:activate tensorflow
5、测试TensorFlow是否安装完成终端进⼊python:输⼊:
import tensorflow as tf
hello = tf.constant(\"hello, tensorflow!\")sess = tf.Session()print(sess.run(hello))
输出: b'hello, tensorflow!',即成功6、在Jupiter中使⽤TensorFlow准备⼯作:
安装ipython,安装jupyter
conda install ipythonconda install jupyter
输⼊:
ipython kernelspec install-self --user
看到类似这个结果 Installed kernelspec python3 in C:\\Users\\XXX\\Jupyter\\kernels\\python3即可以了!打开AnacondaJupiter稍等⼀会
复制⽹址,浏览器打开
新建python3⽂件输⼊:
import tensorflow as tftf.__version__
输出:
即安装成功!
7、安装成功后,每次使⽤ TensorFlow 的时候都需要激活 conda 环境
//查看环境
conda info --envs//激活环境
activate tensorflow//关闭环境
deactivate tensorflow
到此这篇关于在Anaconda3下使⽤清华镜像源安装TensorFlow(CPU版) 的⽂章就介绍到这了,更多相关Anaconda3安装TensorFlow(CPU版) 内容请搜索以前的⽂章或继续浏览下⾯的相关⽂章希望⼤家以后多多⽀持!