Skip to content

fix: support torch 2.x (closes #167)#177

Merged
chanshing merged 1 commit into
mainfrom
fix/torch2-compat
Feb 28, 2026
Merged

fix: support torch 2.x (closes #167)#177
chanshing merged 1 commit into
mainfrom
fix/torch2-compat

Conversation

@chanshing

Copy link
Copy Markdown
Member

Loosen torch/torchvision version pins to allow PyTorch 2.x. Fixes a torch.load() call that breaks in torch 2.x due to positional arg change. Tested E2E with torch 2.0.1 (SSL + RF models, CSV + CWA inputs).

Files Changed

setup.py

  • Loosen torch pin from ==1.13.* to >=1.13,<3
  • Loosen torchvision pin from ==0.14.* to >=0.14,<1

src/stepcount/models.py

  • Use keyword arg map_location= in torch.load() for torch 2.x compat

**`setup.py`**
- Loosen torch pin from ==1.13.* to >=1.13,<3
- Loosen torchvision pin from ==0.14.* to >=0.14,<1

**`src/stepcount/models.py`**
- Use keyword arg map_location= in torch.load() for torch 2.x compat
@chanshing chanshing marked this pull request as ready for review February 28, 2026 22:16
@chanshing chanshing merged commit 3aa8b80 into main Feb 28, 2026
15 checks passed
@chanshing chanshing deleted the fix/torch2-compat branch February 28, 2026 22:16
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.

1 participant