HiSup
HiSup copied to clipboard
Fine tuning pretrained models but it turns out the pretrained model does not have encoder part.
Dear Sarah,
I would like to kindly ask how to use pretrained model (e.g. hrnet-w48-v2 backbone) as the following screenshot shows.
What I have done is loading this pretrained model and then use the train function to start fine-tuning.
As this screenshot shows:
However, it always has an error 'BuildingDetector' object has no attribute 'encoder' as the following shows:
I run these experiments in Google CoLab now with a support of an A100 GPU. I have used the pretrained model for inference. It works quite well. That is why I would like to fine-tune it to improve its performance further.
Thanks so much for providing this great work and look forward to your reply : )
Hi,
We have only set the encoder module for training mode as shown in the code below. https://github.com/SarahwXU/HiSup/blob/69e0cb3c7039bd038139ae0b95ea4ef03b2e5162/hisup/detector.py#L69-L71 so if you want to finetune from the pretrained models, you need to disable testing mode. https://github.com/SarahwXU/HiSup/blob/69e0cb3c7039bd038139ae0b95ea4ef03b2e5162/hisup/detector.py#L234
Hi,
We have only set the encoder module for training mode as shown in the code below.
https://github.com/SarahwXU/HiSup/blob/69e0cb3c7039bd038139ae0b95ea4ef03b2e5162/hisup/detector.py#L69-L71
so if you want to finetune from the pretrained models, you need to disable testing mode. https://github.com/SarahwXU/HiSup/blob/69e0cb3c7039bd038139ae0b95ea4ef03b2e5162/hisup/detector.py#L234
Hello XJKunn,
Thanks so much for your prompt reply. Now it works after setting test as False.
KInd regards