pip安装方法
sudo sh Anaconda3-5.2.0-Linux-x86_64.sh
2.创建名为 tensorflow 的 conda 环境,以运行某个版本的 Python:
conda create -n tensorflow pip python=3.6
3.激活 conda 环境
source activate tensorflow
4.在 conda 环境中安装 TensorFlow
pip install --ignore-installed --upgrade \-i \
若使用conda安装,可以自动在环境中安装cuda,cudnn等环境。
conda install tensorflow
5.验证安装
在命令行输入python
$ python
# Python
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
conda 安装安装方法
tensorflow1.10版本快捷安装方式
1.在annconda下建立环境
2.激活环境
conda install tensorflow-gpu=1.10
在conda安装方式下,无需像pip,需要安装指定版本的cuda和cudnn,在环境下,自动安装匹配的cuda和cudnn.