Linux系统升级PyTorch到最新版主要有以下两种方法:
pip install --upgrade pip。pip install --upgrade torch torchvision torchaudio,可指定CUDA版本,如pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu121(适用于CUDA 12.1)。conda update conda。conda update pytorch torchvision torchaudio cudatoolkit=X.X -c pytorch,将X.X替换为对应的CUDA版本号,不使用GPU则可省略cudatoolkit参数。