hasanirtiza / Pedestron

[Pedestron] Generalizable Pedestrian Detection: The Elephant In The Room. @ CVPR2021
https://openaccess.thecvf.com/content/CVPR2021/papers/Hasan_Generalizable_Pedestrian_Detection_The_Elephant_in_the_Room_CVPR_2021_paper.pdf
Apache License 2.0
687 stars 159 forks source link

Collab demo not working #97

Closed ksindwan closed 3 years ago

ksindwan commented 3 years ago

Thanks for your error report and we appreciate it a lot.

Checklist

  1. I have searched related issues but cannot get the expected help.
  2. The bug has not been fixed in the latest version.

Describe the bug A clear and concise description of what the bug is.

['demo/1.png', 'demo/3.png', 'demo/2.png'] The model and loaded state dict do not match exactly

unexpected key in source state_dict: mask_head.0.conv_res.conv.weight, mask_head.0.conv_res.conv.bias, mask_head.1.conv_res.conv.weight, mask_head.1.conv_res.conv.bias, mask_head.2.conv_res.conv.weight, mask_head.2.conv_res.conv.bias

[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] 3/3, 0.5 task/s, elapsed: 6s, ETA: 0s /content/Pedestron/tools/../mmdet/apis/inference.py:39: UserWarning: Class names are not saved in the checkpoint's meta data, use COCO classes by default. warnings.warn('Class names are not saved in the checkpoint\'s ' /usr/local/lib/python3.7/site-packages/torch/nn/functional.py:2479: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details. "See the documentation of nn.Upsample for details.".format(mode))

Reproduction

  1. What command or script did you run?
    
    conda run python tools/demo.py configs/elephant/cityperson/cascade_hrnet.py ./models_pretrained/CascadeRCNNCP_model.pth.stu demo/ result_demo/```
  2. Did you make any modifications on the code or config? Did you understand what you have modified? No
  3. What dataset did you use? COCO

Environment

Error traceback If applicable, paste the error trackback here.

A placeholder for trackback.

Bug fix If you have already identified the reason, you can provide the information here. If you are willing to create a PR to fix it, please also leave a comment here and that would be much appreciated!

hasanirtiza commented 3 years ago

What do you exactly mean by not working? As per your output, I believe your result images are in result_demo/ folder (did you check it ?). Based on what you have pasted, demo.py did what it is suppose to do.

ksindwan commented 3 years ago

_"unexpected key in source state_dict: mask_head.0.conv_res.conv.weight, mask_head.0.conv_res.conv.bias, mask_head.1.conv_res.conv.weight, mask_head.1.conv_res.conv.bias, mask_head.2.conv_res.conv.weight, mask_head.2.convres.conv.bias"

What does this mean ?

hasanirtiza commented 3 years ago

It is a warning and the reason is -> The model and loaded state dict do not match exactly. I am not sure which pre-trained model are you using, but probably your mask head is used during training and not available for testing/demo etc.

ksindwan commented 3 years ago

I am using this model _"CascadeRCNNCPmodel.pth.stu". This file only consists of the weights and not the architecture, right ?