學校的環(huán)境已經搭載好了,因為開學延期,可能要5月初才能開學,這幾天想在自己的PC上玩玩卷積神經網絡预吆,忘記當時怎么搭載的pytorch和TensorFlow環(huán)境,導致走了不少彎路胳泉。以下基于win10 純凈版拐叉。
1. 安裝anaconda3,以管理員身份運行扇商。添加環(huán)境凤瘦,在安裝的時候要打勾。
2. 安裝Nvidia 驅動案铺,和control panel英偉達控制面板蔬芥,查找cuda版本
3. 打開anaconda prompt,Anaconda-Pytorch中Python3.7創(chuàng)建環(huán)境安裝? conda create –n pytorch python=3.7
4. 添加清華鏡像源
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 --set show_channel_urls yes
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
(這步一定放到最后,報錯原因不詳)
最后執(zhí)行pytorch安裝
conda install pytorch torchvision cudatoolkit=10.1 (pytorch官網查找cuda版本對應型號笔诵,上圖我的cuda是10.1)
5. 同樣方法構建TensorFlow環(huán)境返吻,用pip安裝
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow-gpu==2.0.0-alpha0
6. 輸入conda list查看包是否齊全
7. pip install --upgrade 要升級的包名
8. pip install future
9. windows下輸入 pip --default-timeout=100 install tensorboard
linux下輸入 pip --default-timeout=100 install -U? tensorboard
以上順帶解決終端未響應報錯的問題
依然報錯
pip install future
10. 安裝scikit-image
Pip install scikit-image -i https://pypi.tuna.tsinghua.edu.cn/simple
11.安裝tqdm
Pip install tqdm -i https://pypi.tuna.tsinghua.edu.cn/simple
至此,基本上已經安裝了pytorch框架所需的大部分包