在Ubuntu系统上升级PyTorch,主要有以下两种推荐方法:
pip uninstall torch torchvision torchaudio。pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu117;若用CPU版本则:pip install torch torchvision torchaudio。pip show torch查看版本。conda activate <your_env>。conda remove pytorch torchvision torchaudio。conda install pytorch torchvision torchaudio cudatoolkit=<your_cuda_version> -c pytorch,如conda install pytorch torchvision torchaudio cudatoolkit=11.7 -c pytorch,不使用GPU可省略cudatoolkit参数。conda list torch查看版本。