plemeri / InSPyReNet

Official PyTorch implementation of Revisiting Image Pyramid Structure for High Resolution Salient Object Detection (ACCV 2022)
MIT License
321 stars 61 forks source link

Model difference between Res2Net50 Backbone and Res2Net50 [DUTS-TR] trained checkpoint #33

Closed HappyBang-ai closed 12 months ago

HappyBang-ai commented 1 year ago

Thank you for your amazing paper, I was really facinated by your works.

But when I run inference code about Res2net50, It stucked by error which is about state_dict error SwinB works well but only for Res2net50. I attached my run command and error.

run command python run/Inference.py --config configs/InSPyReNet_Res2Net50.yaml --source myfolder --type rgba --gpu --verbose

error RuntimeError: Error(s) in loading state_dict for InSPyReNet: Unexpected key(s) in state_dict: "backbone.fc.weight", "backbone.fc.bias".

I download checkpoint by here (https://github.com/plemeri/InSPyReNet/blob/main/docs/getting_started.md ) and checkpoint by here (https://github.com/plemeri/InSPyReNet/blob/main/docs/model_zoo.md)

Thanks.

plemeri commented 1 year ago

Sorry for the inconvenience. There's a quick turnaround by simply changing the Model.pretrained argument from True to False. You may find this parameter in the config file.

Thank you and I'll fix this issue later.

HappyBang-ai commented 1 year ago

@plemeri I'm sorry but it still doesn't work,

I faced same error message just like before. RuntimeError: Error(s) in loading state_dict for InSPyReNet: Unexpected key(s) in state_dict: "backbone.fc.weight", "backbone.fc.bias".

This is my InSPyReNet_Res2Net50.yaml file

Model: name: "InSPyReNet_Res2Net50" depth: 64 pretrained: False base_size: [384, 384] threshold: NULL

Is there anything that I missed?

Thanks.

plemeri commented 12 months ago

I'm so sorry about the problem. This checkpoint was trained when we did not removed the above fc layer in the res2net backbone. I'll fix this problem immediately.