mac os下如何尝试编译 tensorflow
发表于:2026-11-02 作者:千家信息网编辑
千家信息网最后更新 2026年11月02日,本篇文章给大家分享的是有关mac os下如何尝试编译 tensorflow,小编觉得挺实用的,因此分享给大家学习,希望大家阅读完这篇文章后可以有所收获,话不多说,跟着小编一起来看看吧。编译环境及其工具
千家信息网最后更新 2026年11月02日mac os下如何尝试编译 tensorflow
本篇文章给大家分享的是有关mac os下如何尝试编译 tensorflow,小编觉得挺实用的,因此分享给大家学习,希望大家阅读完这篇文章后可以有所收获,话不多说,跟着小编一起来看看吧。
编译环境及其工具
编译工具:bazel (https://bazel.build/versions/master/docs/bazel-overview.html)
mac 操作系统版本:16.1.0 Darwin Kernel
tensorflow 版本:github 当前master分支
编译操作过程
git clone https://github.com/tensorflow/tensorflow
cd tensorflow
./configure
配置过程没有使用GPU
bazel build -c opt //tensorflow/tools/pip_package:build_pip_package
bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
sudo pip install /tmp/tensorflow_pkg/tensorflow-1.0.1-cp27-cp27m-macosx_10_12_intel.whl
hello world 案例
(dev-djdemo) ➜ dev-djdemo python
Python 2.7.10 (default, Jul 30 2016, 18:31:42)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> hello = tf.constant('Hello, TensorFlow!')
>>> sess = tf.Session()
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
>>> print(sess.run(hello))
Hello, TensorFlow!
以上就是mac os下如何尝试编译 tensorflow,小编相信有部分知识点可能是我们日常工作会见到或用到的。希望你能通过这篇文章学到更多知识。更多详情敬请关注行业资讯频道。
编译
尝试
工具
更多
版本
知识
篇文章
过程
实用
操作系统
分支
就是
工作会
文章
案例
环境
看吧
知识点
系统
行业
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
哈尔滨大商圈互联网科技有限公司
上海卓越科技互联网
智网互联网科技
礼当家互联网科技
亿人帮互联网科技
成都狮子座互联网科技
互联网科技公司招聘
安控科技rtu产品工业互联网
恒银科技与互联网金融
昭通云南众福互联网科技有限公司
互联网系的金融科技公司
河南猎农互联网科技有限公司
河南住房之家互联网科技
华夏恒生科技与互联网科技
济南有互联网科技公司吗
江苏互联网科技小贷
扫呗互联网科技有限公司
湖北辰鑫科技互联网
上海万顺科技互联网有限公司招聘
互联网科技创业有什么好项目
河南真二互联网科技有限公司
北京互联网科技
腾讯科技 互联网女皇
隆华科技工业互联网
温州喔噻互联网科技有限公司
荆州市昕露互联网络科技有限公司
四川慕妮娅互联网科技有限公司
用友工业互联网科技发展
北京瑞云互联网科技有限公司
互联网科技创业有什么好项目