Skip to content

fix: handle digit-bearing model architectures in M3L Signed-off-by: nitbig <nitishkr13245@gmail.com> - #968

Open
nitbig wants to merge 2 commits into
kubeedge:mainfrom
nitbig:nitbig-patch-1
Open

fix: handle digit-bearing model architectures in M3L Signed-off-by: nitbig <nitishkr13245@gmail.com>#968
nitbig wants to merge 2 commits into
kubeedge:mainfrom
nitbig:nitbig-patch-1

Conversation

@nitbig

@nitbig nitbig commented Aug 28, 2026

Copy link
Copy Markdown

What this PR does / why we need it:

This PR improves model architecture extraction in the M3L ReID model loader.

The previous regular expression only supported architecture names containing alphabetic characters, which caused supported models such as resnet50 and resnet101 to fail during model loading.

The updated expression supports architecture names containing letters, numbers, underscores and hyphens. It also explicitly supports both .pth and .pth.tar checkpoint formats.

The model loader now raises a clear ValueError when the architecture cannot be inferred from the checkpoint filename instead of failing with an unclear AttributeError.

The existing addmm_ update is also retained to use the current PyTorch keyword based API.

Testing:

Verified architecture extraction for IBNMeta, resnet50 and other digit based architecture names.

Verified support for .pth and .pth.tar checkpoint filenames.

Verified that invalid checkpoint filenames produce a clear ValueError.

Which issue(s) this PR fixes:

Fixes #445

nitbig added 2 commits August 28, 2026 03:29
Refactor model loading and prediction methods for clarity and error handling. Update regex for architecture extraction and improve code formatting.
@kubeedge-bot

Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: nitbig
To complete the pull request process, please assign moorezheng after the PR has been reviewed.
You can assign the PR to them by writing /assign @moorezheng in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubeedge-bot kubeedge-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[MOT17] M3L basemodel.py: unguarded regex crashes on non-standard checkpoints; deprecated addmm_ API removed in PyTorch ≥ 2.0

2 participants