Mac安装tensorflow
来源:互联网 发布:iphone游戏推荐 知乎 编辑:程序博客网 时间:2024/05/21 09:29
1.二进制安装
# brew install python
# pip install https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl//当前版本只支持 CPU
2.源码安装
# brew install python
# brew install bazel
# pip install -U swig six numpy wheel
# brew install coreutils //For CUDA(可选)
# git clone --recurse-submodules https://github.com/tensorflow/tensorflow
# cd tensorflow
# ./configure //配置
报错解决
Do you wish to build TensorFlow with MKL support? [y/N] yMKL support will be enabled for TensorFlowDo you wish to download MKL LIB from the web? [Y/n] yDarwin is unsupported yet# 这里MKL不支持Darwin(MAC),因此要选择NERROR: /Users/***/Documents/tensorflow/tensorflow/core/BUILD:1331:1: C++ compilation of rule '//tensorflow/core:lib_hash_crc32c_accelerate_internal' failed: cc_wrapper.sh failed: error executing command external/local_config_cc/cc_wrapper.sh -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -fcolor-diagnostics -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG ... (remaining 32 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.clang: error: no such file or directory: 'y'clang: error: no such file or directory: 'y'# 这里是因为在configure的时候有些包不支持但是选择了y,因此记住一点所有的都选N参考
# bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package //编译CPU版本
# bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package //编译GPU版本
# bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg//构建出.whl安装文件
# pip install /tmp/tensorflow_pkg/tensorflow-1.2.0-cp27-cp27m-macosx_10_12_x86_64.whl//安装
3.测试:(新打开一个终端执行)
# Python
>>> import tensorflow as tf
>>> hello = tf.constant('Hello, TensorFlow!')
>>> sess = tf.Session()
>>> print(sess.run(hello))
4.卸载tensorflow
# pip uninstall tensorflow
安装参考
- mac 安装tensorflow
- mac下安装tensorflow
- TensorFlow安装(Mac
- Mac 上安装 tensorflow
- Mac安装tensorflow 1.0
- tensorflow mac 安装教程
- Mac安装tensorflow
- Mac安装TensorFlow/Caffe
- MAC安装tensorflow
- MAC, Centos 安装tensorflow。
- Mac安装TensorFlow
- Mac安装tensorflow
- Mac安装TensorFlow
- mac安装tensorflow
- mac源码安装tensorflow
- mac 安装 tensorflow
- MAC Tensorflow安装
- MAC OS安装tensorflow
- Go实战--go语言中使用YAML配置文件(与json、xml、ini对比)
- 添加第三方聊天软件QQ/微信/Twitter等桌面角标---NotificationListenerService
- php新手入门必读!
- [IOS APP]黄雀记-经典有声文学
- Qt5最快最好的程序发布方法——windeployqt
- Mac安装tensorflow
- android 2017面试题
- 字符串相关的高频面试题
- php还是java,选择比努力更重要!
- 20170622总结
- Hyper-V虚拟机文件丢失的数据恢复全过程
- 守护进程&创建
- android系统架构的个人理解
- 内联函数