Tensorflow/Keras/Anaconda/Pycharm 安裝流程
在官網下載並安裝anaconda(安裝時Path選項打鉤)
在開始菜單下運行Anaconda prompt,並輸入:
Where python #查看python安裝位置
Python -V #查看python版本
Conda info -e #查看anaconda已創建的環境
Conda -V #查看anaconda版本
設置國內鏡像源,提高下載速度,繼續輸入:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --set show_channel_urls yes
創建環境,環境名:tf1.14,使用python3.6
conda create -n tf1.14 python=3.6
進入剛剛創建好的環境,並查詢python和pip版本
activate tf1.14
python -V
pip -V
安裝tensorflow1.14
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow==1.14
查看tensorflow版本信息
pip show tensorflow
輸入代碼,進入python
python
輸入下列代碼,成功則確認無誤
import tensorflow
退出,並重新查看版本
exit()
where pip
pip list
where python
安裝Keras(tensorflow1.14配合Keras2.2.5)
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple keras==2.2.5 #安裝Keras
在官網下載並安裝Pycharm
選擇剛剛創建好的環境:
File-Settings-Project:python程序-Project interpreter
選取Anaconda文件中的路徑:
位置Anaconda\envs\tf1.14\python.exe