-
Notifications
You must be signed in to change notification settings - Fork 559
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Support TTA #771
base: dev-1.x
Are you sure you want to change the base?
Conversation
Hi, I adapt your code but got the following error: Traceback (most recent call last):
File "tools/test.py", line 145, in <module>
main()
File "tools/test.py", line 141, in main
runner.test()
File "/opt/conda/envs/mmdet3/lib/python3.8/site-packages/mmengine/runner/runner.py", line 1767, in test
metrics = self.test_loop.run() # type: ignore
File "/opt/conda/envs/mmdet3/lib/python3.8/site-packages/mmengine/runner/loops.py", line 435, in run
self.run_iter(idx, data_batch)
File "/opt/conda/envs/mmdet3/lib/python3.8/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/opt/conda/envs/mmdet3/lib/python3.8/site-packages/mmengine/runner/loops.py", line 454, in run_iter
outputs = self.runner.model.test_step(data_batch)
File "/opt/conda/envs/mmdet3/lib/python3.8/site-packages/mmengine/model/test_time_aug.py", line 140, in test_step
predictions.append(self.module.test_step(data))
File "/opt/conda/envs/mmdet3/lib/python3.8/site-packages/mmengine/model/base_model/base_model.py", line 145, in test_step
return self._run_forward(data, mode='predict') # type: ignore
File "/opt/conda/envs/mmdet3/lib/python3.8/site-packages/mmengine/model/base_model/base_model.py", line 340, in _run_forward
results = self(**data, mode=mode)
File "/opt/conda/envs/mmdet3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "mmdetection-3.0.0/mmdet/models/detectors/base.py", line 94, in forward
return self.predict(inputs, data_samples)
File "mmdetection-3.0.0/mmdet/models/detectors/single_stage.py", line 109, in predict
x = self.extract_feat(batch_inputs)
File "mmdetection-3.0.0/mmdet/models/detectors/single_stage.py", line 148, in extract_feat
x = self.neck(x)
File "/opt/conda/envs/mmdet3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "mmdetection-3.0.0/mmdet/models/necks/cspnext_pafpn.py", line 153, in forward
torch.cat([upsample_feat, feat_low], 1))
RuntimeError: Sizes of tensors must match except in dimension 1. Expected size 76 but got size 75 for tensor number 1 in the list. Could you please take a look at this? |
RTMDet can't handle image size 1200, because it cant divide by 32, you change 1200 to 1280 in tta config |
It works but another problem occurs when calculating mAP, I found that the
mmrotate/mmrotate/evaluation/metrics/dota_metric.py Lines 297 to 307 in 8b30525
|
maybe you should change config like this img_scales = [(1024, 1024), (800, 800), (1280, 1280) , (640,640),(1344,1344),(1534,1534)] add [dict(type='mmdet.LoadAnnotations', with_bbox=True, box_type='qbox')] |
@jamiechoi1995 did you solve this mAP calculation problem? I have the same problem. |
I have solve the problem. It should put the 'mmdet.LoadAnnotations' and 'ConvertBoxType' behind the 'mmdet.RandomFlip'. |
mmdet >= 3.0.0rc6