Problem Description
When installing dependencies from requirements.txt, users encounter a PyTorch/torchvision compatibility error:
RuntimeError: operator torchvision::nms does not exist
The issue occurs because:
requirements.txt specifies torchvision without version constraints
pytorch_lightning is specified without version constraints
- This leads to pip installing incompatible versions of PyTorch and torchvision
- The
torchvision::nms operator is not available in the installed torchvision version
Problematic versions that get installed:
- PyTorch: 2.7.1 (very recent)
- torchvision: 0.22.1 (incompatible with PyTorch 2.7.1)
- numpy: 2.3.0 (incompatible with other dependencies)
Proposed Solution
Pin compatible versions
Update requirements.txt to specify compatible versions:
pytorch-lightning==2.5.1.post0
torch==2.1.2
torchvision==0.16.2
numpy==1.26.4