開發(fā)環(huán)境
window10 + python3.5 + anaconda + tensorflow3 + pycharm
安裝步驟
- conda添加國(guó)內(nèi)鏡像
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
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/bioconda/
- 添加公司代理
conda config --set proxy_servers.http http://我司賬號(hào):我司密碼@proxy.huawei.com:8080
conda config --set proxy_servers.https https://我司賬號(hào):我司密碼@proxy.huawei.com:8080
- 關(guān)掉ssl校驗(yàn)
conda config --set ssl_verify false
- 創(chuàng)建并激活TensorFlow虛擬環(huán)境
conda create -n tensorflow python=3.5
activate tensorflow
- 安裝TensorFlow
conda install -c conda-forge tensorflow
- 檢查是否安裝成功
>>python
import tensorflow as tf
- 修改pycharm編譯器
pycharm-->file-->settings-->project Interpreter-->右邊齒輪Add-->conda environment-->existing environment-->添加路徑(d:\anaconda3\envs\tensorflow\python.exe)