anaconda 下安裝 TensorFlow
阿新 • • 發佈:2019-03-27
import config chan -- ima bubuko 軟件 -a on()
- 下載安裝anaconda(Anaconda3-2018.12-Windows-x86_64);
- 配置conda默認鏈接鏡像地址,使用清華大學開源軟件鏡像:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ conda config --set show_channel_urls yes
- 在Anaconda Prompt中輸入命令;
- 查看當前可用Tensorflow版本:
其中 _py35, _py37是當前Tensorflow支持的python版本conda search --full -name tensorflow
- 創建Tensorflow環境,安裝python3.7:
查看所有環境名: conda info --envsconda create --name tensorflow python=3.7
- 激活創建的tensorflow環境:
退出當前激活的環境: deactivateactivate tensorflow
- 在tensorflow環境中,正式安裝Tensorflow包:
pip install --upgrade --ignore-installed tensorflow
- 驗證是否安裝成功:
進入python環境,並輸入以下代碼:
> python import tensorflow as tf hello = tf.constant('hello, world') sess = tf.Session() print(sess.run(hello))
安裝完畢
anaconda 下安裝 TensorFlow