mac下python2.7 tensorflow安装

本文指导在macOS 10.13.6环境下使用Python 2.7安装TensorFlow 1.10.1,并通过简单代码验证安装成功。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

环境:
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 #若已安装则更新到最新版本
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
3.测试tensorflow安装成功

新建hello.py

import tensorflow as tf

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

sess.close()

执行:

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!

完!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值