在CentOS下选择PyTorch版本时,需要考虑以下几个关键因素:
nvidia-smi
命令查看你的显卡支持的CUDA版本。gcc
、openssl-devel
、bzip2-devel
、libffi-devel
等。conda create -n pytorch_env python=3.9
conda activate pytorch_env
conda install pytorch torchvision torchaudio cudatoolkit=11.8 -c pytorch -c nvidia
pip install torch torchvision torchaudio -f https://pypi.tuna.tsinghua.edu.cn/simple
import torch
print(torch.__version__)
print(torch.cuda.is_available())
通过以上步骤,你应该能够在CentOS上成功选择并安装适合自己需求的PyTorch版本。如果在安装过程中遇到问题,建议查阅PyTorch官方文档或寻求社区的帮助。