在 Anaconda下解決國內安裝tensorflow等下載慢和中斷,出錯,異常問題的一點思路


 

把鏡像地址改為清華大學開源軟件鏡像站,打開 管理員身份打開cmd 輸入
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes

之后在cmd下輸入命令安裝,建立TensorFlow的anaconda虛擬環境

conda create -n tensorflow python=3.5 anaconda

#conda create -n tensorflow-gpu python=3.5 anaconda

 

 啟動anaconda虛擬環境

activate tensorflow

 

在anaconda環境中安裝TensorFlow和Keras

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple keras

pip install  tensorflow

pip install  keras

pip install -I https://mirrors.tuna.tsinghua.edu.cn/tensorflow/windows/cpu/tensorflow-1.1.0-cp35-cp35m-win_amd64.whl

 

參考 : https://mirrors.tuna.tsinghua.edu.cn/help/pypi/

https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/

 

如果需要升級pip:               python -m pip install --upgrade pip

如果未定義考慮anaconda環境變量是否配置好。

 https://blog.csdn.net/weixin_39750084/article/details/85722233

activate tensorflow之后,輸入python查看python版本號,並可以編寫測試

如果在虛擬環境下,進入jupyter notebook之后,通過

import sys

sys.executable

查看到notebook還是處於一個非虛擬的python之下時,需要使用如下命令。

conda install nb_conda

安裝相關插件。安裝過慢則更改鏡像路徑。如本文所寫

之后重啟,在notebook中修改環境。。。。。

 插件:

conda install -c conda-forge jupyter_contrib_nbextensions

 

 

 

參考鏈接:

https://www.jianshu.com/p/afea092dda1d
https://blog.csdn.net/sinat_34328764/article/details/83214172




免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM