1、下载并安装64位的python 3.5.2,官网写目前只有3.5.x版本对TensorFlow进行了支持
2、运行命令行,执行pip3 install --upgrade tensorflow
结果,一直在Retry始终不成功,报connection to pypi.python.org timed out的错误。
Retry结束后还提示Could not find a version that satisfies the requirement tensorflow (from version:)
No matching distribution found for tensorflow的错误。
我尝试换一些命令参数,将URL换成国内镜像均不行。
最后才发现是网络问题,虽然公司的开发网经过申请后可以访问外网,但是tensorflow的获取和安装始终不行,在笔记本上wifi环境下,安装顺利成功
3、按照官网的指引进行测试
>>> import tensorflow as tf
>>> hello = tf.constant('Hello, TensorFlow!')
>>> sess = tf.Session()-----3
>>> print(sess.run(hello))
成功。PS:第一次在Python命令下输入以上语句时,第三句报错了,原因没有细究,第二次以后正常。