中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

mac os下如何嘗試編譯 tensorflow

發布時間:2021-12-23 15:28:07 來源:億速云 閱讀:164 作者:柒染 欄目:大數據

本篇文章給大家分享的是有關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,小編相信有部分知識點可能是我們日常工作會見到或用到的。希望你能通過這篇文章學到更多知識。更多詳情敬請關注億速云行業資訊頻道。

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

洛南县| 崇明县| 蒲江县| 额敏县| 将乐县| 寻甸| 天气| 报价| 苏尼特右旗| 嵊泗县| 许昌市| 永寿县| 南木林县| 阜宁县| 山阴县| 金湖县| 长岭县| 荥阳市| 库伦旗| 肃宁县| 西青区| 西和县| 中方县| 贺兰县| 元阳县| 巴彦淖尔市| 苗栗县| 建湖县| 乐至县| 邯郸市| 开封市| 方城县| 深水埗区| 灯塔市| 乐清市| 通许县| 西安市| 永宁县| 麻江县| 博白县| 金寨县|