在 MacBook Pro M2 Max 上安装 PyTorch
安装 PyTorch
sudo conda create --name pytorch python
conda activate pytorch
conda install pytorch torchvision torchaudio -c pytorch
安装每日构建版本
pip3 install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cpu
升级
pip3 install --upgrade --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cpu
训练模型 import torch import torchvision import torchvision.transforms as transforms print(f"PyTorch version: {torch.











