tenserflow 学习之框架安装

由于一台电脑,平时需要上网、编辑文档等原因就用了Windows来安装tenserflow了,电脑虽有GPU但是鉴于只是学习就偷懒用了CPU版本的,具体安装如下:

1、安装Python3.6,安装比较简单,找到:[windows–x86-64 executable installer]
(https://www.python.org/ftp/python/3.6.2/python-3.6.2-amd64.exe),直接安装就行了
2、安装通用版的tenserflow:

  • pip3 install --upgrade tensorflow,但是这个不一定能够充分利用你的CPU;安装过程中可能会出现安装失败(网络问题,反复执行命令直至成功安装)。安装完成后执行如下命令:

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

可能会出现如下提示:

C:\tf_jenkins\workspace\rel-win\M\windows\PY\36\tensorflow\core\platform\cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2

这时候如果想要充分利用自己的CPU可以下载利用AVX2预编译的版本:tensorflow-1.6.0-cp36-cp36m-win_amd64.whl
安装上面下载的tenserflow版本:


pip install --ignore-installed --upgrade /path/to/binary.wh

/path/to/ 为下载文件的目录
安装完后再次验证:


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

至此tenserflow 安装结束,可以开心地学习了,如不想翻墙可以通过如下网站学习tenserflow

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容