在CentOS上更新PyTorch,可使用pip或conda,具體如下:
pip install --upgrade pip
。pip uninstall torch torchvision torchaudio
。pip install torch torchvision torchaudio
。若需特定版本,可指定版本號,如pip install torch==2.3.1 torchvision==0.14.1 torchaudio==0.13.1
。python -c "import torch; print(torch.__version__)"
。conda activate your_environment_name
。conda update conda
。conda update pytorch torchvision torchaudio -c pytorch
。若需特定版本,可指定版本號,如conda install pytorch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1 cudatoolkit=11.7 -c pytorch
。conda list torch
。