最近開始學習TensorFlow,配置如下:
1、首先打開cmd,通過Anaconda創建一個名爲tensorflow的python3.5環境
conda create -n tensorflow python=3.5
2、啓動tensorflow環境
activate tensorflow
3、安裝cpu版TensorFlow
pip install tensorflow-1.1.0rc2-cp35-cp35m-win_amd64.whl
如果不行,輸入:
pip install tensorflow
4、測試tensorflow是否正確安裝
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
sess.run(hello)
接下來是如何在Jupyter中使用TensorFlow:
1、進入tensorFlow環境,安裝ipython和jupyter
conda install ipython
conda install jupyter
2、運行命令
ipython kernelspec install-self --user
3、進去Jupyter
jupyter notebook
import tensorflow as tf