1、查看已有虚拟环境
conda env list
2、创建虚拟环境
conda create -n env_name python=3.8
3、删除虚拟环境
conda remove -n env_name --all
4、激活虚拟环境
conda activate env_name
5、克隆虚拟环境
conda create -n env2 --clone env1
6、查看cuda版本(11.6)
nvcc-v
nvidia-smi
使用以下命令查看 CUDA 和 PyTorch 的版本
python -c 'import torch;print(torch.__version__);print(torch.version.cuda)'
7、查看torch版本,及安装、更新、卸载
查看版本
python
import torch
print(torch.__version__) #双下划线
卸载
pip uninstall torch
安装三件套
pip install torch==1.13.1+cu116 torchvision==0.14.1+cu116 torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/cu116 -i https://pypi.mirrors.ustc.edu.cn/simple/
pip install torch==1.13.0
更新
pip install --upgrade torch==1.13.0
8、安装torchvision
pip install --upgrade pytorch torchvision==0.14.0
9、卸载mmcv或mmcv-full
pip uninstall mmcv
pip uninstall mmcv-full