win10 安裝 tensorflow 並運行helloworld
折騰了一下,在win10上成功安裝tensorflow.
1 下載安裝python,注意一定要是64位(比如python-3.5.1-amd64)的,建議直接下載.exe版本的,在安裝的時候選擇添加環境變量;
2 下載最新的 tensorflow-1.1.0rc0-cp35-cp35m-win_amd64.whl 包;
3 輸入命令pip install tensorflow-1.1.0rc0-cp35-cp35m-win_amd64.whl進行安裝;
4 跑HellWorld進行測試;
跑HelloWorld
import tensorflow as tf
matrix1 = tf.constant([[ 3., 3.]])
matrix2 = tf.constant([[ 2.], [ 2.]])
product = tf.matmul(matrix1, matrix2)
sess = tf.Session()
result = sess.run(product)
print (result)
sess.close()
matrix1 = tf.constant([[ 3., 3.]])
matrix2 = tf.constant([[ 2.], [ 2.]])
product = tf.matmul(matrix1, matrix2)
sess = tf.Session()
result = sess.run(product)
print (result)
sess.close()
