question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enhance HoverNet to support torchvision's resnet50 pretrained weights

See original GitHub issue

The encoder part of HoverNet follows the reference, and is a version of preact-resnet50. Our implementation has the same structure except some different layer names, thus we defined a function _load_pretrained_encoder to do the remap to load the provided weights from the reference. However, the encoder is not a generic version and cannot match torchvision’s standard resnet50. Therefore, it would be nice to adapt our implementation and support this version too.

I already tried to add this feature, and submitted a draft PR (https://github.com/Project-MONAI/MONAI/pull/5688), and I will do some changes and make it for review.

cc @Nic-Ma @wyli @KumoLiu

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Reactions:1
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
wylicommented, Dec 14, 2022

thanks @yiheng-wang-nv for the investigation, maybe later we can work on a second version to improve the flexibility and keep #5688 if it’s needed for this release cc @Nic-Ma

I agree, what do you mean “keep https://github.com/Project-MONAI/MONAI/pull/5688 if it’s needed for this release”? I think you mean to merge #5688 first?

Yes I think we merge if needed

1reaction
wylicommented, Dec 13, 2022

is it possible to in general allow for a ‘backbone’ module as the encoder, like the MILModel?

https://github.com/Project-MONAI/MONAI/blob/492ebc6516c3a82368f6779d24f101617e60f92d/monai/networks/nets/milmodel.py#L41-L44

Read more comments on GitHub >

github_iconTop Results From Across the Web

Models and pre-trained weights — Torchvision main ... - PyTorch
Initializing pre-trained models. As of v0.13, TorchVision offers a new Multi-weight support API for loading different weights to the existing model builder ...
Read more >
Support more flexible ways to instantiate models in torchvision ...
torchvision.models.resnet50(include_top=False). load pretrained weights when class number doesn't equals to 1000(imagenet):.
Read more >
Model Zoo - Deep learning code and pretrained models for ...
ModelZoo curates and provides a platform for deep learning researchers to easily find code and pre-trained models for a variety of platforms and...
Read more >
Image Classification using Pre-trained Models in PyTorch
In this post, we will cover how we can use TorchVision module to load pre-trained models and carry out model inference to classify...
Read more >
How to load a torchvision model from disk? - Stack Overflow
Either set pretrained=False and load you weights using: checkpoint = torch.load('../input/torchvision-fasterrcnn-resnet-50/model.pth.tar') ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found