参考:http://blog.csdn.net/a595130080/article/details/55506237
安装pip
命令:sudo easy_install pip
这里需要输入用户密码,这里注意下使用了sudo后面安装也都要用sudo,输入后开始下载安装后出现如下提示:
Finished processing dependencies for pip
命令:sudo easy_install --upgrade six 或者 sudo easy_install -U six
「
--help里有提示:
--upgrade (-U) force upgrade (searches PyPI for latest versions)
」
输入用户密码
下载安装后出现如下提示
Finished processing dependencies for six
安装tensorflow
命令:pip install tensorflow --user
这里最好保持电脑常亮,避免下载失败
加--user避免出现错误
error: could not create '/Library/Python/2.7/site-packages/html5lib': Permission denied
出现如下提示说明安装成功啦
Successfully installed backports.weakref-1.0.post1 bleach-1.5.0 enum34-1.1.6 funcsigs-1.0.2 futures-3.2.0 html5lib-0.9999999 markdown-2.6.11 mock-2.0.0 numpy-1.14.0 pbr-3.1.1 protobuf-3.5.1 tensorflow-1.4.1 tensorflow-tensorboard-0.4.0 werkzeug-0.14.1 wheel-0.30.0
简单调试测试:
命令行输入python 进入python环境
>>> import tensorflow as tf
>>> hello = tf.constant('Hello, TensorFlow!')
>>> sess = tf.Session()
2018-01-27 10:53:05.737736: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.2 AVX AVX2 FMA
>>> print(sess.run(hello))
Hello, TensorFlow!
这里的Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.2 AVX AVX2 FMA 只是说没有把CPU调到最高模式,其实不影响,可以不用管,要解决也可以自己去stackflow上搜下
网友评论