You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I pip the lastest mmdetection from source and use M-Rcnn architectecture but during the training it has follow bug, the img_mata doesn't have key of [pad_shape]
Reproduction
What command or script did you run?
Did you make any modifications on the code or config? Did you understand what you have modified?
I use new backbone and dataset. I think the model can load sussucceful means the change is reasonable
3. What dataset did you use?
UIIS coco format dataset
Environment
sys.platform: linux
Python: 3.11.11 | packaged by conda-forge | (main, Dec 5 2024, 14:17:24) [GCC 13.3.0]
CUDA available: False
MUSA available: False
numpy_random_seed: 2147483648
GCC: gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-18)
PyTorch: 2.1.2
PyTorch compiling details: PyTorch built with:
GCC 9.3
C++ Version: 201703
Intel(R) oneAPI Math Kernel Library Version 2022.1-Product Build 20220311 for Intel(R) 64 architecture applications
Traceback (most recent call last):
File "/rds/general/user/xl4423/home/AutoSAM/mmdetection/tools/train.py", line 123, in
main()
File "/rds/general/user/xl4423/home/AutoSAM/mmdetection/tools/train.py", line 119, in main
runner.train()
File "/rds/general/user/xl4423/home/anaconda3/envs/AutoSAM/lib/python3.11/site-packages/mmengine/runner/runner.py", line 1777, in train
model = self.train_loop.run() # type: ignore
^^^^^^^^^^^^^^^^^^^^^
File "/rds/general/user/xl4423/home/anaconda3/envs/AutoSAM/lib/python3.11/site-packages/mmengine/runner/loops.py", line 98, in run
self.run_epoch()
File "/rds/general/user/xl4423/home/anaconda3/envs/AutoSAM/lib/python3.11/site-packages/mmengine/runner/loops.py", line 115, in run_epoch
self.run_iter(idx, data_batch)
File "/rds/general/user/xl4423/home/anaconda3/envs/AutoSAM/lib/python3.11/site-packages/mmengine/runner/loops.py", line 131, in run_iter
outputs = self.runner.model.train_step(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/rds/general/user/xl4423/home/anaconda3/envs/AutoSAM/lib/python3.11/site-packages/mmengine/model/base_model/base_model.py", line 114, in train_step
losses = self._run_forward(data, mode='loss') # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/rds/general/user/xl4423/home/anaconda3/envs/AutoSAM/lib/python3.11/site-packages/mmengine/model/base_model/base_model.py", line 361, in _run_forward
results = self(**data, mode=mode)
^^^^^^^^^^^^^^^^^^^^^^^
File "/rds/general/user/xl4423/home/anaconda3/envs/AutoSAM/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/rds/general/user/xl4423/home/anaconda3/envs/AutoSAM/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/rds/general/user/xl4423/home/AutoSAM/mmdetection/mmdet/models/detectors/base.py", line 92, in forward
return self.loss(inputs, data_samples)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/rds/general/user/xl4423/home/AutoSAM/mmdetection/mmdet/models/detectors/two_stage.py", line 175, in loss
rpn_losses, rpn_results_list = self.rpn_head.loss_and_predict(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/rds/general/user/xl4423/home/AutoSAM/mmdetection/mmdet/models/dense_heads/base_dense_head.py", line 165, in loss_and_predict
losses = self.loss_by_feat(*loss_inputs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/rds/general/user/xl4423/home/AutoSAM/mmdetection/mmdet/models/dense_heads/rpn_head.py", line 125, in loss_by_feat
losses = super().loss_by_feat(
^^^^^^^^^^^^^^^^^^^^^
File "/rds/general/user/xl4423/home/AutoSAM/mmdetection/mmdet/models/dense_heads/anchor_head.py", line 500, in loss_by_feat
anchor_list, valid_flag_list = self.get_anchors(
^^^^^^^^^^^^^^^^^
File "/rds/general/user/xl4423/home/AutoSAM/mmdetection/mmdet/models/dense_heads/anchor_head.py", line 196, in get_anchors
featmap_sizes, img_meta['pad_shape'], device)
~~~~~~~~^^^^^^^^^^^^^
KeyError: 'pad_shape'
Bug fix
I am trying to fix it.
The text was updated successfully, but these errors were encountered:
Thanks for your error report and we appreciate it a lot.
Checklist
Describe the bug
I pip the lastest mmdetection from source and use M-Rcnn architectecture but during the training it has follow bug, the img_mata doesn't have key of [pad_shape]
Reproduction
I use new backbone and dataset. I think the model can load sussucceful means the change is reasonable
3. What dataset did you use?
UIIS coco format dataset
Environment
sys.platform: linux
Python: 3.11.11 | packaged by conda-forge | (main, Dec 5 2024, 14:17:24) [GCC 13.3.0]
CUDA available: False
MUSA available: False
numpy_random_seed: 2147483648
GCC: gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-18)
PyTorch: 2.1.2
PyTorch compiling details: PyTorch built with:
TorchVision: 0.16.2
OpenCV: 4.10.0
MMEngine: 0.10.5
MMDetection: 3.3.0+cfd5d3a
Error traceback
The traceback shows following
Traceback (most recent call last):
File "/rds/general/user/xl4423/home/AutoSAM/mmdetection/tools/train.py", line 123, in
main()
File "/rds/general/user/xl4423/home/AutoSAM/mmdetection/tools/train.py", line 119, in main
runner.train()
File "/rds/general/user/xl4423/home/anaconda3/envs/AutoSAM/lib/python3.11/site-packages/mmengine/runner/runner.py", line 1777, in train
model = self.train_loop.run() # type: ignore
^^^^^^^^^^^^^^^^^^^^^
File "/rds/general/user/xl4423/home/anaconda3/envs/AutoSAM/lib/python3.11/site-packages/mmengine/runner/loops.py", line 98, in run
self.run_epoch()
File "/rds/general/user/xl4423/home/anaconda3/envs/AutoSAM/lib/python3.11/site-packages/mmengine/runner/loops.py", line 115, in run_epoch
self.run_iter(idx, data_batch)
File "/rds/general/user/xl4423/home/anaconda3/envs/AutoSAM/lib/python3.11/site-packages/mmengine/runner/loops.py", line 131, in run_iter
outputs = self.runner.model.train_step(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/rds/general/user/xl4423/home/anaconda3/envs/AutoSAM/lib/python3.11/site-packages/mmengine/model/base_model/base_model.py", line 114, in train_step
losses = self._run_forward(data, mode='loss') # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/rds/general/user/xl4423/home/anaconda3/envs/AutoSAM/lib/python3.11/site-packages/mmengine/model/base_model/base_model.py", line 361, in _run_forward
results = self(**data, mode=mode)
^^^^^^^^^^^^^^^^^^^^^^^
File "/rds/general/user/xl4423/home/anaconda3/envs/AutoSAM/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/rds/general/user/xl4423/home/anaconda3/envs/AutoSAM/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/rds/general/user/xl4423/home/AutoSAM/mmdetection/mmdet/models/detectors/base.py", line 92, in forward
return self.loss(inputs, data_samples)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/rds/general/user/xl4423/home/AutoSAM/mmdetection/mmdet/models/detectors/two_stage.py", line 175, in loss
rpn_losses, rpn_results_list = self.rpn_head.loss_and_predict(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/rds/general/user/xl4423/home/AutoSAM/mmdetection/mmdet/models/dense_heads/base_dense_head.py", line 165, in loss_and_predict
losses = self.loss_by_feat(*loss_inputs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/rds/general/user/xl4423/home/AutoSAM/mmdetection/mmdet/models/dense_heads/rpn_head.py", line 125, in loss_by_feat
losses = super().loss_by_feat(
^^^^^^^^^^^^^^^^^^^^^
File "/rds/general/user/xl4423/home/AutoSAM/mmdetection/mmdet/models/dense_heads/anchor_head.py", line 500, in loss_by_feat
anchor_list, valid_flag_list = self.get_anchors(
^^^^^^^^^^^^^^^^^
File "/rds/general/user/xl4423/home/AutoSAM/mmdetection/mmdet/models/dense_heads/anchor_head.py", line 196, in get_anchors
featmap_sizes, img_meta['pad_shape'], device)
~~~~~~~~^^^^^^^^^^^^^
KeyError: 'pad_shape'
Bug fix
I am trying to fix it.
The text was updated successfully, but these errors were encountered: