Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance Hovernet load pretrained weights functionality #6268

Closed
yiheng-wang-nv opened this issue Apr 2, 2023 · 0 comments · Fixed by #6269
Closed

Enhance Hovernet load pretrained weights functionality #6268

yiheng-wang-nv opened this issue Apr 2, 2023 · 0 comments · Fixed by #6269
Assignees

Comments

@yiheng-wang-nv
Copy link
Contributor

yiheng-wang-nv commented Apr 2, 2023

Currently, _remap_standard_resnet_model is designed according to the network structure shown in https://pytorch.org/vision/main/models/generated/torchvision.models.resnet50.html .
Therefore, we assume that there is not extra key (see also here ) to extract the expected state dict.
It would be nice to make the network be compatible with the weights that contain some other keys. For example, users may also save other information rather than state dict within the weights:

dict_keys(['epoch', 'arch', 'state_dict', 'optimizer', 'version', 'args', 'amp_scaler', 'metric'])

Therefore, I suggest we can add an arg to support this kind of case. In addition, we can also add some notifications within the load function to help users double check that if the load method is successful.

cc @KumoLiu

@yiheng-wang-nv yiheng-wang-nv self-assigned this Apr 2, 2023
@wyli wyli closed this as completed in #6269 Apr 3, 2023
wyli pushed a commit that referenced this issue Apr 3, 2023
Fixes #6268 .

### Description

This PR enhances Hovernet's load pretrained function.

### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).
- [ ] Breaking change (fix or new feature that would cause existing
functionality to change).
- [ ] New tests added to cover the changes.
- [ ] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [ ] Quick tests passed locally by running `./runtests.sh --quick
--unittests --disttests`.
- [ ] In-line docstrings updated.
- [ ] Documentation updated, tested `make html` command in the `docs/`
folder.

---------

Signed-off-by: Yiheng Wang <[email protected]>
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 a pull request may close this issue.

1 participant