pytorch环境配置(linux)

本说明针对在没有sudo权限下配置pytorch环境

一、安装anaconda

参考博客

https://blog.csdn.net/x124612/article/details/99937650

需要注意的是,用wget下载下来的不一定是Anaconda3-5.0.1-Linux-x86_64.sh,第二步可以先跳过,在完成后用conda init bash(不一定是bash,这块填你用的shell就对了)即可,如果显示no change,可以退出当前的shell再重新进入即可。

二、配置pytorch环境

 conda create -n py36 python=3.6
 conda activate py36

python和pip一下检查是否成功

pip install torch==1.6.0+cu101 torchvision==0.7.0+cu101 -f https://download.pytorch.org/whl/torch_stable.html
pip install munch
pip install pyyaml
pip install sklearn
pip install imageio
pip install tensorboard

可能遇到的bug
在任意步安装失败,可以优先尝试

 pip install --upgrade pip

或多试几次,大部分是网络问题,如遇到下载过慢,可以尝试换源。

Logo

更多推荐