博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

Anaconda(python3.5)安装 tensorflow

Posted on 2018-05-29 21:59  LiaoSin  阅读(2927)  评论(0)    收藏  举报

1)terminal

2)依次执行如下代码

conda create -n tensorflow python=3.5
source activate tensorflow
conda install pandas matplotlib jupyter notebook scipy scikit-learn
conda install -c conda-forge tensorflow

退出该环境时“source deactivate tensorflow”

3)验证是否安装好? terminal——jupyter notebook

import tensorflow as tf

Create TensorFlow object called tensor

hello_constant = tf.constant('Hello World!')

with tf.Session() as sess:
# Run the tf.constant operation in the session
output = sess.run(hello_constant)
print(output)

若输出 b'Hello World!' 即为安装成功!