Skip to content

fix: pin torchvision and torchaudio for torch 2.7.0 compatibility#53

Open
hybridindie wants to merge 1 commit into
mainfrom
fix/torch-dependencies
Open

fix: pin torchvision and torchaudio for torch 2.7.0 compatibility#53
hybridindie wants to merge 1 commit into
mainfrom
fix/torch-dependencies

Conversation

@hybridindie

Copy link
Copy Markdown
Owner

Summary

  • Pin torchvision to 0.22.0 (must match torch 2.7.x)
  • Pin torchaudio to >=2.7.0,<2.8.0

This prevents version mismatches that cause runtime errors like:

RuntimeError: operator torchvision::nms does not exist

Test plan

  • Verify uv sync installs correct versions
  • Verify ComfyUI starts without torch/torchvision errors

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings December 23, 2025 16:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread pyproject.toml

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",

Copilot AI Dec 23, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
"torchvision==0.22.0",
"torchvision>=0.22.0,<0.23.0",

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants