创建Anaconda虚拟环境
conda create --name mt python=3.8
激活该环境
conda activate name
安装PyTorch
conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch
验证
#python python 3.8.12 (default, Oct 12 2021, 13:49:34) [GCC 7.5.0] :: Anaconda, Inc. on linux Type "help", "copyright", "credits" or "license" for more information. >>>import torch >>> torch.cuda.is_available() True >>> torch.cuda.device_count() 1
退出
>>>quit()
下载包
conda install -n name package
关闭虚拟环境
Linux下:source deactivate
删除虚拟环境
conda remove -n name --all
安装部分包
conda install --channel https://conda.anaconda.org/SimpleITK SimpleITK
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)