fix: pin torchvision and torchaudio for torch 2.7.0 compatibility#53
fix: pin torchvision and torchaudio for torch 2.7.0 compatibility#53hybridindie wants to merge 1 commit into
Conversation
Add explicit version constraints for the torch ecosystem: - torchvision==0.22.0 (must match torch 2.7.x) - torchaudio>=2.7.0,<2.8.0 This prevents version mismatches that cause runtime errors like "operator torchvision::nms does not exist". 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR pins torchvision and torchaudio dependencies to ensure compatibility with torch 2.7.0, preventing runtime errors such as RuntimeError: operator torchvision::nms does not exist.
Key changes:
- Added torchvision==0.22.0 as an explicit dependency
- Added torchaudio>=2.7.0,<2.8.0 as an explicit dependency
- Updated lockfile with compatible versions (all released on 2025-04-23)
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pyproject.toml | Adds torchvision (exact pin to 0.22.0) and torchaudio (range 2.7.x) dependencies to match the existing torch 2.7.x constraint |
| uv.lock | Updates lockfile with torchvision 0.22.0 and torchaudio 2.7.0, plus incidental dependency updates (filelock, importlib-metadata, joblib, pyparsing) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| dependencies = [ | ||
| "torch>=2.7.0,<2.8.0", # Pinned minor: torch 2.9.x causes NaN outputs with coremltools 9.0 | ||
| "torchvision==0.22.0", |
There was a problem hiding this comment.
Inconsistent version pinning strategy: torchvision uses an exact pin (==0.22.0) while torch and torchaudio use version ranges (>=2.7.0,<2.8.0). This inconsistency could cause maintenance issues and confusion. Consider using a consistent approach - either exact pins for all three packages or ranges for all three. If torchvision needs to be exactly pinned due to specific compatibility requirements, consider adding a comment explaining why.
| "torchvision==0.22.0", | |
| "torchvision>=0.22.0,<0.23.0", |
Summary
This prevents version mismatches that cause runtime errors like:
Test plan
uv syncinstalls correct versions🤖 Generated with Claude Code