Closed Senwang98 closed 2 years ago
我debug了几天,换了几个mmdet版本都跑不通。。模型加载是没问题了,build_teacher里面还要套一层MMDistributedDataParallel,不然会报参数list(Tensor)对不上DataContainer,但是又给我报错TypeError: kd_feat_loss is not a tensor or list of tensors
losses: {'kd_feat_loss': 0, 'kd_channel_loss': 0, 'kd_spatial_loss': 0, 'kd_nonlocal_loss': 0.0, 'loss_rpn_cls': [tensor(0.4318, device='cuda:0', grad_fn=<MulBackward0>), tensor(0.1646, device='cuda:0', grad_fn=<MulBackward0>), tensor(0.0469, device='cuda:0', grad_fn=<MulBackward0>), tensor(0.0213, device='cuda:0', grad_fn=<MulBackward0>), tensor(0.0296, device='cuda:0', grad_fn=<MulBackward0>)], 'loss_rpn_bbox': [tensor(0.0399, device='cuda:0', grad_fn=<MulBackward0>), tensor(0.0577, device='cuda:0', grad_fn=<MulBackward0>), tensor(0.0251, device='cuda:0', grad_fn=<MulBackward0>), tensor(0.0113, device='cuda:0', grad_fn=<MulBackward0>), tensor(0.0429, device='cuda:0', grad_fn=<MulBackward0>)], 'loss_cls': tensor(4.4297, device='cuda:0', grad_fn=<MulBackward0>), 'acc': tensor([0.], device='cuda:0'), 'loss_bbox': tensor(0.0252, device='cuda:0', grad_fn=<MulBackward0>)}
他给的几个loss都是值,mmdet里面self._parse_losses(losses)需要解析Tensor或者list
@Shawnnnnn 在CWD上的基础上实现这个ICLR的论文吧,思路反正简单,没必要在语法上纠结,而且这个工作没那么简洁,点现在看不是很好,不影响对KD-det领域的把握
@ArchipLab-LinfengZhang Hi, When using code you provide, I meet weight load mismatch problem. Since x101-32d.pth's url is unavailable, I just download
cascade_mask_rcnn_x101_32x4d_fpn_dconv_c3-c5_1x_coco-e75f90c8
Teacher's backbone is set to have no pretrained weight.build_teacher() function:
But I think I have replace all thing you mentioned, I still meet teacher's weight mismatch problem as following:
Have you met similiar problem?