DevashishPrasad / CascadeTabNet

This repository contains the code and implementation details of the CascadeTabNet paper "CascadeTabNet: An approach for end to end table detection and structure recognition from image-based documents"
MIT License
1.47k stars 422 forks source link

Encounter problems when run 'main.py' in folder " Table Structure Recognition". #74

Open henanjun opened 3 years ago

henanjun commented 3 years ago

The model and loaded state dict do not match exactly

size mismatch for rpn_head.rpn_cls.weight: copying a param with shape torch.Size([3, 256, 1, 1]) from checkpoint, the shape in current model is torch.Size([9, 256, 1, 1]). size mismatch for rpn_head.rpn_cls.bias: copying a param with shape torch.Size([3]) from checkpoint, the shape in current model is torch.Size([9]). size mismatch for rpn_head.rpn_reg.weight: copying a param with shape torch.Size([12, 256, 1, 1]) from checkpoint, the shape in current model is torch.Size([36, 256, 1, 1]). size mismatch for rpn_head.rpn_reg.bias: copying a param with shape torch.Size([12]) from checkpoint, the shape in current model is torch.Size([36]). unexpected key in source state_dict: bbox_head.0.fc_cls.weight, bbox_head.0.fc_cls.bias, bbox_head.0.fc_reg.weight, bbox_head.0.fc_reg.bias, bbox_head.0.shared_fcs.0.weight, bbox_head.0.shared_fcs.0.bias, bbox_head.0.shared_fcs.1.weight, bbox_head.0.shared_fcs.1.bias, bbox_head.1.fc_cls.weight, bbox_head.1.fc_cls.bias, bbox_head.1.fc_reg.weight, bbox_head.1.fc_reg.bias, bbox_head.1.shared_fcs.0.weight, bbox_head.1.shared_fcs.0.bias, bbox_head.1.shared_fcs.1.weight, bbox_head.1.shared_fcs.1.bias, bbox_head.2.fc_cls.weight, bbox_head.2.fc_cls.bias, bbox_head.2.fc_reg.weight, bbox_head.2.fc_reg.bias, bbox_head.2.shared_fcs.0.weight, bbox_head.2.shared_fcs.0.bias, bbox_head.2.shared_fcs.1.weight, bbox_head.2.shared_fcs.1.bias, mask_head.0.convs.0.conv.weight, mask_head.0.convs.0.conv.bias, mask_head.0.convs.1.conv.weight, mask_head.0.convs.1.conv.bias, mask_head.0.convs.2.conv.weight, mask_head.0.convs.2.conv.bias, mask_head.0.convs.3.conv.weight, mask_head.0.convs.3.conv.bias, mask_head.0.upsample.weight, mask_head.0.upsample.bias, mask_head.0.conv_logits.weight, mask_head.0.conv_logits.bias, mask_head.1.convs.0.conv.weight, mask_head.1.convs.0.conv.bias, mask_head.1.convs.1.conv.weight, mask_head.1.convs.1.conv.bias, mask_head.1.convs.2.conv.weight, mask_head.1.convs.2.conv.bias, mask_head.1.convs.3.conv.weight, mask_head.1.convs.3.conv.bias, mask_head.1.upsample.weight, mask_head.1.upsample.bias, mask_head.1.conv_logits.weight, mask_head.1.conv_logits.bias, mask_head.2.convs.0.conv.weight, mask_head.2.convs.0.conv.bias, mask_head.2.convs.1.conv.weight, mask_head.2.convs.1.conv.bias, mask_head.2.convs.2.conv.weight, mask_head.2.convs.2.conv.bias, mask_head.2.convs.3.conv.weight, mask_head.2.convs.3.conv.bias, mask_head.2.upsample.weight, mask_head.2.upsample.bias, mask_head.2.conv_logits.weight, mask_head.2.conv_logits.bias

Traceback (most recent call last): File "main.py", line 25, in result = inference_detector(model, i) File "/data/home/nanjunhe/mmdetection-master/mmdet/apis/inference.py", line 114, in inference_detector result = model(return_loss=False, rescale=True, data) File "/data/home/nanjunhe/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in call result = self.forward(*input, *kwargs) File "/data/home/nanjunhe/mmdetection-master/mmdet/core/fp16/decorators.py", line 51, in new_func return old_func(args, kwargs) File "/data/home/nanjunhe/mmdetection-master/mmdet/models/detectors/base.py", line 170, in forward return self.forward_test(img, img_metas, kwargs) File "/data/home/nanjunhe/mmdetection-master/mmdet/models/detectors/base.py", line 150, in forward_test return self.simple_test(imgs[0], img_metas[0], kwargs) File "/data/home/nanjunhe/mmdetection-master/mmdet/models/detectors/two_stage.py", line 189, in simple_test assert self.with_bbox, 'Bbox head must be implemented.' AssertionError: Bbox head must be implemented