虚拟环境安装指定版本的pytorch
- 安装
bash + 制定版本的Anconda.sh
- 创建虚拟环境,qq指的是你的虚拟环境名称(随意)
conda create -n qq python=3.6.1
- 进入虚拟环境qq
source activate qq
- 安装指定版本pytorch,我这里安装的是1.6版本
conda install pytorch==1.6.0 torchvision==0.7.0 cudatoolkit=10.1
注意,此时仅仅是在终端的torch版本改变成1.6而已!!!
- 还需要jupyter notebook中添加虚拟环境
conda install nb_conda
恭喜!这样你就可以在jupyter notebook中使用1.6版本的torch了