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命令下輸入以上語句時,第三句報錯了,原因沒有細究,第二次以后正常。