build(deps): unpin torch and remove torchvision from CPU requirements#2848
build(deps): unpin torch and remove torchvision from CPU requirements#2848pctablet505 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates requirements.txt to pin torch and torchvision to specific versions. However, the specified versions (2.13.0 and 0.28.0) do not exist. The reviewer pointed out this issue, identifying it as hallucinated 'AI slop' in violation of the repository style guide, and suggested using valid, existing versions such as torch==2.6.0 and torchvision==0.21.0.
| torch==2.13.0 | ||
| torchvision==0.28.0 |
There was a problem hiding this comment.
The specified versions torch==2.13.0 and torchvision==0.28.0 do not exist. PyTorch's latest stable release is 2.6.0 (with torchvision 0.21.0). This appears to be hallucinated 'AI slop' (violating Repository Style Guide Rule 2). Please use a valid, existing matched pair of PyTorch and torchvision versions, such as torch==2.6.0 and torchvision==0.21.0.
torch==2.6.0
torchvision==0.21.0
References
- Rule 2: Call out 'AI Slop' - Actively look for and identify 'AI slop'—generic, overly verbose, or hallucinated code that lacks context or violates best practices. (link)
|
Hi @pctablet505 , Thanks for the PR..! This was always a latent issue.I would prefer not to hard-pin torch and torch vision, as it creates an ongoing maintenance burden for every future PyTorch release. |
|
@pctablet505 Please resolve the conflicts and as i mentioned earlier no hard pinning for torch version. Thanks |
728de37 to
188a3c3
Compare
|
Apologies , my earlier suggestion to remove torchvision. I missed to check the SAM3 test files that run in the torch CI job. These tests exercise the full model forward pass which hits roi_align.py: import torchvision at runtime. So torchvision is a hard runtime dependency for SAM3 on the torch backend, not just an optional one. Your original approach of pinning matched versions is the correct fix( We need to keep eye on to update these hard pinned versions time to time) Thanks..! |

Problem
The CPU torch CI leg was resolving a CUDA-build
torchfrom PyPI alongside a CPU-buildtorchvisionfrom the PyTorch extra index, causing an ABI mismatch:This also broke the lazy
Qwen2ForCausalLMimport fromtransformersat collection time.Fix
Remove the
torchvisiondependency entirely and leavetorchunpinned inrequirements.txt. The Keras Hub test suite does not needtorchvision, so dropping it avoids the ABI mismatch without requiring a pinned matched pair.Only the CPU leg (
requirements.txt) changes; the CUDA requirements file is untouched.