以下是一些Ubuntu与PyTorch的集成开发环境推荐:
conda create -n pytorch_env python=3.8,激活环境conda activate pytorch_env。conda install pytorch torchvision torchaudio cpuonly -c pytorch,GPU版conda install pytorch torchvision torchaudio cudatoolkit=11.8 -c pytorch -c nvidia(需先安装CUDA和cuDNN)。sudo apt update,sudo apt install python3 python3-pip。python3 -m venv pytorch_env,source pytorch_env/bin/activate。pip3 install torch torchvision torchaudio,GPU版pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu118(需先安装CUDA和cuDNN)。此外,还可安装Jupyter Notebook等工具辅助开发。若使用IDE,如PyCharm、VSCode等,需配置对应的虚拟环境解释器。