Tensorflow配置和Jupyter安裝

最近開始學習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  
發佈了68 篇原創文章 · 獲贊 32 · 訪問量 12萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章