深度学习实战演练

第三章(1.4)linux下部署tensorflow环境

2019-01-13  本文已影响0人  _两只橙_

一、在安装好 anaconda后,即可通过anaconda安装tensorflow

conda create -n tensorflow pip python=3.6
source activate tensorflow
source deactivate tensorflow
 pip install --upgrade --ignore-installed tensorflow
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
#退出tensorflow环境
source deactivate tensorflow
#运行
pip install tensorflow
pip install  --upgrade pip

二、直接在python3.6中安装

sudo pip install --upgrade --ignore-installed tensorflow
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))

因为anaconda安装的时候用户默认为root,所以装其他的装不上。
更改anaconda目录的用户为xqt(原来是root)否则会导致安装不上,权限不够。

sudo chown -R xqt:xqt anaconda3/

关注我的技术公众号,每天推送优质文章
关注我的音乐公众号,工作之余放松自己
微信扫一扫下方二维码即可关注:


音乐公众号
技术公众号
上一篇 下一篇

猜你喜欢

热点阅读