美文网首页我爱编程
Mac安装TensorFlow

Mac安装TensorFlow

作者: 李小西033 | 来源:发表于2018-02-25 13:29 被阅读24次
  • 运行下列命令进行安装配置
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
  • 测试安装是否成功
    在 Python console 下运行下列代码,检测 TensorFlow 是否正确安装。
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)

如果安装正确,Console 会打印出 "Hello, world!"。


test tensorflow

相关文章

网友评论

    本文标题:Mac安装TensorFlow

    本文链接:https://www.haomeiwen.com/subject/nrlrxftx.html