Mac下TensorFlow的部署和安装

来源:互联网 发布:python量化课程视频 编辑:程序博客网 时间:2024/05/16 19:13
  1. $ sudo easy_install pip  
  2. $ sudo easy_install --upgrade six  
  3. $ sudo pip install --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.8.0rc0-py2-none-any.whl
   安装完成后,即可运行测试用例

$ python  ...  >>> import tensorflow as tf  >>> hello = tf.constant('Hello, TensorFlow!')  >>> sess = tf.Session()  >>> print(sess.run(hello))    Hello, TensorFlow!  >>> a = tf.constant(10)  >>> b = tf.constant(32)  >>> print(sess.run(a + b))    42>>>