microsoft / RepPoints

Represent Visual Objects by Point Sets
MIT License
589 stars 75 forks source link

Test Problem #13

Open shengtao96 opened 5 years ago

shengtao96 commented 5 years ago

I copy RepPoints src and configs into mmdetection,
and use

python tools/test.py configs/reppoints/reppoints_moment_r101_fpn_2x.py weights/reppoints_moment_r101_fpn_2x.pth --eval bbox --json_out a.json

to test the model in the mmdetection dir. However, I get an error.

loading annotations into memory... Done (t=0.06s) creating index... index created! [>>>>>>>>>>>>>>>>>> ] 7311/20288, 9.2 task/s, elapsed: 796s, ETA: 1412sTraceback (most recent call last): File "tools/test.py", line 239, in main() File "tools/test.py", line 199, in main outputs = single_gpu_test(model, data_loader, args.show) File "tools/test.py", line 32, in single_gpu_test result, det_time, nms_time = model(return_loss=False, rescale=not show, data) File "/home/shengtao/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/nn/modules/module.py", line 493, in call result = self.forward(*input, *kwargs) File "/home/shengtao/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 150, in forward return self.module(inputs[0], kwargs[0]) File "/home/shengtao/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/nn/modules/module.py", line 493, in call result = self.forward(*input, kwargs) File "/home/shengtao/models/RepPoints/mmdet/core/fp16/decorators.py", line 49, in new_func return old_func(*args, kwargs) File "/home/shengtao/models/RepPoints/mmdet/models/detectors/base.py", line 88, in forward return self.forward_test(img, img_meta, kwargs) File "/home/shengtao/models/RepPoints/mmdet/models/detectors/base.py", line 79, in forward_test return self.simple_test(imgs[0], img_metas[0], *kwargs) File "/home/shengtao/models/RepPoints/mmdet/models/detectors/single_stage.py", line 66, in simple_test outs = self.bbox_head(x) File "/home/shengtao/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/nn/modules/module.py", line 493, in call result = self.forward(input, kwargs) File "/home/shengtao/models/RepPoints/mmdet/models/anchor_heads/reppoints_head.py", line 291, in forward return multi_apply(self.forward_single, feats) File "/home/shengtao/models/RepPoints/mmdet/core/utils/misc.py", line 24, in multi_apply return tuple(map(list, zip(map_results))) File "/home/shengtao/models/RepPoints/mmdet/models/anchor_heads/reppoints_head.py", line 280, in forward_single self.relu(self.reppoints_cls_conv(cls_feat, dcn_offset))) File "/home/shengtao/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/nn/modules/module.py", line 493, in call result = self.forward(input, *kwargs) File "/home/shengtao/models/RepPoints/mmdet/ops/dcn/deform_conv.py", line 236, in forward self.dilation, self.groups, self.deformable_groups) File "/home/shengtao/models/RepPoints/mmdet/ops/dcn/deform_conv.py", line 55, in forward cur_im2col_step) RuntimeError: input image is smaller than kernel (shape_check at mmdet/ops/dcn/src/deform_conv_cuda.cpp:127) frame #0: c10::Error::Error(c10::SourceLocation, std::string const&) + 0x45 (0x7f3f5d088dc5 in /home/shengtao/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/lib/libc10.so) frame #1: shape_check(at::Tensor, at::Tensor, at::Tensor, at::Tensor, int, int, int, int, int, int, int, int, int, int) + 0x720 (0x7f3f0e5686a0 in /home/shengtao/models/RepPoints/mmdet/ops/dcn/deform_conv_cuda.cpython-37m-x86_64-linux-gnu.so) frame #2: deform_conv_forward_cuda(at::Tensor, at::Tensor, at::Tensor, at::Tensor, at::Tensor, at::Tensor, int, int, int, int, int, int, int, int, int, int, int) + 0xf5 (0x7f3f0e569325 in /home/shengtao/models/RepPoints/mmdet/ops/dcn/deform_conv_cuda.cpython-37m-x86_64-linux-gnu.so) frame #3: + 0x233f0 (0x7f3f0e57d3f0 in /home/shengtao/models/RepPoints/mmdet/ops/dcn/deform_conv_cuda.cpython-37m-x86_64-linux-gnu.so) frame #4: + 0x2354e (0x7f3f0e57d54e in /home/shengtao/models/RepPoints/mmdet/ops/dcn/deform_conv_cuda.cpython-37m-x86_64-linux-gnu.so) frame #5: + 0x1ff91 (0x7f3f0e579f91 in /home/shengtao/models/RepPoints/mmdet/ops/dcn/deform_conv_cuda.cpython-37m-x86_64-linux-gnu.so)

frame #11: THPFunction_apply(_object*, _object*) + 0x691 (0x7f3f830d8891 in /home/shengtao/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/lib/libtorch_python.so)

Who can help me ?

What's more, I find the weight reppoints_moment_r101_dcn_fpn_2x.pth has no params for dcn part.

The code

python tools/test.py configs/reppoints/reppoints_moment_r101_dcn_fpn_2x.py weights/reppoints_moment_r101_dcn_fpn_2x.pth --eval bbox --json_out a.json

gets warnings

loading annotations into memory... Done (t=0.44s) creating index... index created! The model and loaded state dict do not match exactly missing keys in source state_dict: backbone.layer3.8.conv2_offset.bias, backbone.layer3.11.conv2_offset.weight, backbone.layer3.5.conv2_offset.weight, backbone.layer3.22.conv2_offset.weight, backbone.layer3.4.conv2_offset.weight, backbone.layer3.10.conv2_offset.weight, backbone.layer3.18.conv2_offset.weight, backbone.layer3.20.conv2_offset.weight, backbone.layer3.17.conv2_offset.weight, backbone.layer4.1.conv2_offset.weight, backbone.layer2.0.conv2_offset.weight, backbone.layer3.13.conv2_offset.weight, backbone.layer3.9.conv2_offset.weight, backbone.layer3.14.conv2_offset.bias, backbone.layer3.16.conv2_offset.bias, backbone.layer3.11.conv2_offset.bias, backbone.layer3.13.conv2_offset.bias, backbone.layer4.2.conv2_offset.weight, backbone.layer3.0.conv2_offset.weight, backbone.layer3.16.conv2_offset.weight, backbone.layer3.0.conv2_offset.bias, backbone.layer3.19.conv2_offset.bias, backbone.layer3.21.conv2_offset.bias, backbone.layer4.0.conv2_offset.weight, backbone.layer3.21.conv2_offset.weight, backbone.layer3.1.conv2_offset.bias, backbone.layer3.6.conv2_offset.weight, backbone.layer3.5.conv2_offset.bias, backbone.layer2.0.conv2_offset.bias, backbone.layer2.2.conv2_offset.bias, backbone.layer3.20.conv2_offset.bias, backbone.layer3.7.conv2_offset.weight, backbone.layer3.12.conv2_offset.bias, backbone.layer3.14.conv2_offset.weight, backbone.layer3.4.conv2_offset.bias, backbone.layer4.1.conv2_offset.bias, backbone.layer3.15.conv2_offset.bias, backbone.layer3.12.conv2_offset.weight, backbone.layer2.3.conv2_offset.weight, backbone.layer3.10.conv2_offset.bias, backbone.layer4.0.conv2_offset.bias, backbone.layer3.7.conv2_offset.bias, backbone.layer3.19.conv2_offset.weight, backbone.layer3.3.conv2_offset.bias, backbone.layer3.8.conv2_offset.weight, backbone.layer2.3.conv2_offset.bias, backbone.layer3.22.conv2_offset.bias, backbone.layer3.9.conv2_offset.bias, backbone.layer2.1.conv2_offset.bias, backbone.layer2.2.conv2_offset.weight, backbone.layer3.17.conv2_offset.bias, backbone.layer3.1.conv2_offset.weight, backbone.layer3.3.conv2_offset.weight, backbone.layer2.1.conv2_offset.weight, backbone.layer3.18.conv2_offset.bias, backbone.layer3.6.conv2_offset.bias, backbone.layer3.2.conv2_offset.bias, backbone.layer3.15.conv2_offset.weight, backbone.layer4.2.conv2_offset.bias, backbone.layer3.2.conv2_offset.weight

but the code

python tools/test.py configs/reppoints/reppoints_moment_r101_fpn_2x.py weights/reppoints_moment_r101_dcn_fpn_2x.pth --eval bbox --json_out a.json

gets nothing.

muditchaudhary commented 5 years ago

I'm getting a similar error for training.

muditchaudhary commented 5 years ago

https://github.com/open-mmlab/mmdetection/issues/1453#issuecomment-538602013

This might help you.

shengtao96 commented 5 years ago

open-mmlab/mmdetection#1453 (comment)

This might help you.

It works for me. Thx :)