以下是在CentOS下更新PyTorch的指南:
pip install --upgrade pip。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 activate your_env_name。conda remove pytorch torchvision torchaudio。conda install pytorch torchvision torchaudio cudatoolkit=11.7 -c pytorch;无需GPU则用:conda install pytorch torchvision torchaudio cpuonly -c pytorch。import torch; print(torch.__version__)。