Debian上PyTorch常用工具清单
一 环境管理与安装工具
sudo apt-get install python3 python3-pip build-essential。python3 -m venv venv && source venv/bin/activate。--gpus all 使用官方 pytorch/pytorch 镜像。示例:docker pull pytorch/pytorch:1.8.1-cuda11.1-cudnn8-devel。二 训练与可视化工具
pip install tensorboard,在代码中用 torch.utils.tensorboard.SummaryWriter 写入日志,浏览器访问 http://localhost:6006。pip install torchvision torchaudio。pip install ultralytics。三 监控与性能分析工具
import torch; print(torch.cuda.is_available()) 检查 CUDA 是否可用。四 部署与加速工具
pip install onnxruntime。-v 挂载 代码、数据、日志 目录,保持环境一致性并便于多机复现。五 快速上手组合示例
python3 -m venv venv && source venv/bin/activatepip install torch torchvision torchaudiopip install tensorboardpython - <<'PY' import torch, torchvision, tensorboard print("torch:", torch.__version__, "torchvision:", torchvision.__version__) print("cuda:", torch.cuda.is_available()) PYdocker pull pytorch/pytorch:1.8.1-cuda11.1-cudnn8-develdocker run --gpus all -it --rm -v $PWD:/work -w /work pytorch/pytorch:1.8.1-cuda11.1-cudnn8-devel bashpython -c "import torch; print('cuda', torch.cuda.is_available())"