当前位置:   article > 正文

mac下python2.7 tensorflow安装_mac m3安装tensorflow2.7 pip install tensorflow-macos

mac m3安装tensorflow2.7 pip install tensorflow-macos==x.y.z

环境:
mac10.13.6
python2.7
tensorflow-1.10.1-cp27-cp27m-macosx_10_11_x86_64.whl

1.安装依赖库
pip install scipy
pip install matplotlib
pip install numpy --ignore-installed numpy #若已安装则更新到最新版本
  • 1
  • 2
  • 3
2.下载tensorflow包

下载地址 https://pypi.org/simple/tensorflow/

这里选择是
tensorflow-1.10.1-cp27-cp27m-macosx_10_11_x86_64.whl版本

安装:

pip install tensorflow-1.10.1-cp27-cp27m-macosx_10_11_x86_64.whl
  • 1
3.测试tensorflow安装成功

新建hello.py

import tensorflow as tf

hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print sess.run(hello)

sess.close()
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

执行:

python hello.py

打印:

hechaojiedeMacBook-Pro:python hecj$ python hello.py 
2018-09-06 10:14:04.221781: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
Hello, TensorFlow!
  • 1
  • 2
  • 3

完!

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/不正经/article/detail/620604
推荐阅读
相关标签
  

闽ICP备14008679号