在CentOS上更新PyTorch版本,主要有以下两种方法:
pip uninstall torch torchvision torchaudio。pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu117;若无需GPU支持,可直接用pip install torch torchvision torchaudio。import torch,print(torch.__version__)。conda update conda。conda remove pytorch torchvision torchaudio cudatoolkit。conda install pytorch torchvision torchaudio cudatoolkit=11.7 -c pytorch;不需要GPU则用conda install pytorch torchvision torchaudio cpuonly -c pytorch。conda list torch。