hustvl / BMaskR-CNN

[ECCV 2020] Boundary-preserving Mask R-CNN
https://arxiv.org/abs/2007.08921
Apache License 2.0
189 stars 41 forks source link

I training my datasets and I have 3 classes,but when I testing ,it has a problem? #5

Closed zhangfusheng-163 closed 4 years ago

zhangfusheng-163 commented 4 years ago

Hello! I have a problem when I test my data. The problem is that: Skip loading parameter 'roi_heads.box_predictor.cls_score.weight' to the model due to incompatible shapes: (81, 1024) in the checkpoint but (4, 1024) in the model! You might want to double check if this is expected. Skip loading parameter 'roi_heads.box_predictor.cls_score.bias' to the model due to incompatible shapes: (81,) in the checkpoint but (4,) in the model! You might want to double check if this is expected. Skip loading parameter 'roi_heads.box_predictor.bbox_pred.weight' to the model due to incompatible shapes: (320, 1024) in the checkpoint but (12, 1024) in the model! You might want to double check if this is expected. Skip loading parameter 'roi_heads.box_predictor.bbox_pred.bias' to the model due to incompatible shapes: (320,) in the checkpoint but (12,) in the model! You might want to double check if this is expected. Skip loading parameter 'roi_heads.mask_head.mask_predictor.weight' to the model due to incompatible shapes: (80, 256, 1, 1) in the checkpoint but (3, 256, 1, 1) in the model! You might want to double check if this is expected. Skip loading parameter 'roi_heads.mask_head.mask_predictor.bias' to the model due to incompatible shapes: (80,) in the checkpoint but (3,) in the model! You might want to double check if this is expected. Skip loading parameter 'roi_heads.mask_head.boundary_predictor.weight' to the model due to incompatible shapes: (80, 256, 1, 1) in the checkpoint but (3, 256, 1, 1) in the model! You might want to double check if this is expected. Skip loading parameter 'roi_heads.mask_head.boundary_predictor.bias' to the model due to incompatible shapes: (80,) in the checkpoint but (3,) in the model! You might want to double check if this is expected.

I set the cfg.MODEL.RETINANET.NUM_CLASSES = 3 about set_up() and_C.MODEL.RETINANET.NUM_CLASSES = 3,_C.MODEL.ROI_HEADS.NUM_CLASSES = 3 about detectron2/config/defaults.py ,what's wrong about it ,or Where I do not set it to do,please tell me ,thank you very much!

wondervictor commented 4 years ago

Hi @zhangfusheng-163, you should change the NUM_CLASSES in your config file but the default.py. config files are inherited from a Base-FPN-RCNN.yaml, in which NUM_CLASSES are defined. To solve your problem, just set the NUM_CLASSES in your own xxxx.yaml.

zhangfusheng-163 commented 4 years ago

Thank you,I had solved it !

wondervictor commented 4 years ago

👌