Mac OS下TensorFlow安装
l 安装环境
Mac OS10+Anaconda+Python3.6.3
l 安装过程
1. 打开终端
2. 在终端输入命令:
shell $ conda create –n tensorflow
创建名为tensorflow的conda环境
3. 执行以下命令激活conda环境
shell $ source activate tensorflow
激活成功后,命令行将变成:
<tensorflow>
4. 执行以下命令在conda环境中安装Tensorflow:
采用pip install,需要注意输入的命令格式
成功示例:
(tensorflow) JoyYudeMacBook-Air:~ joyyu$
pip install --upgradehttps://storage.googleapis.com/tensorflow/mac/tensorflow-0.8.0rc0-py3-none-any.whl
l 验证安装
1. 保证环境可以运行Tensorflow程序
2. 运行一个小的Tensorflow程序
步骤:
1. 打开终端
2. 在shell中执行python:$python
3. 在python交互式shell中输入以下小程序:
import tensorflow as tf
hello=tf.constant(‘Hello,TensorFlow!’)
sess=tf.Session()
print(sess.run(hello))
5086

被折叠的 条评论
为什么被折叠?



