在jupyter平台上使用keras和tensorflow之安裝篇


使用平台為 win10,預先安裝anaconda。使用包管理工具 conda和pip

0. 設置鏡像源為中科大源

conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/main/

conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/

conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/

conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/msys2/

conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/

conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/menpo/

conda config --set show_channel_urls yes

 

1. 建立虛擬環境

conda create -n kr python=3.6

其中,kr為自定義虛擬環境的名稱。

激活一個環境:

  • 在Windows上,在您的Anaconda提示符下運行 activate kr
  • 在macOS和Linux上,在終端窗口中運行 source activate kr

2. conda install nb_conda_kernels 

這條命令的目的是,在終端啟動 jupyter時,可以選擇python的運行在指定虛擬環境上完成。

3. 安裝CPU版本的keres的后端 tensorFlow

pip install tensorflow==2.0 -i https://pypi.doubanio.com/simple

4. 安裝CPU版本的keres

pip install keras==3.6.1 -i https://pypi.doubanio.com/simple

注意: 安裝時注意keras和tensorflow的版本對應關系。比如 tensorflow version == 2.0 和 keras 3.6.1 匹配的具體的對應關系可以見網頁:

https://docs.floydhub.com/guides/environments/


免責聲明!

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



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