TypeError: forward_train() missing 2 required positional arguments: 'gt_bboxes' and 'gt_labels'
See original GitHub issueWhen I use config to train my own data, workflow is set to [(‘train’, 1)] and the training runs normally. When workflow is set to [(‘train’, 1),(‘val’, 1)], val reports the following error:
File "/media/nnir712/F264A15264A119FD/zzh/detect/mmcv/mmcv/runner/runner.py", line 265, in train [0/1828] self.model, data_batch, train_mode=True, **kwargs) File "/media/nnir712/F264A15264A119FD/zzh/detect/mmdetection/mmdet/apis/train.py", line 38, in batch_processor losses = model(**data) File "/home/nnir712/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/nn/modules/module.py", line 547, in __call__ result = self.forward(*input, **kwargs) File "/home/nnir712/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 151, in forward return self.module(*inputs[0], **kwargs[0]) File "/home/nnir712/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/nn/modules/module.py", line 547, in __call__ result = self.forward(*input, **kwargs) File "/media/nnir712/F264A15264A119FD/zzh/detect/mmdetection/mmdet/core/fp16/decorators.py", line 49, in new_func return old_func(*args, **kwargs) File "/media/nnir712/F264A15264A119FD/zzh/detect/mmdetection/mmdet/models/detectors/base.py", line 86, in forward return self.forward_train(img, img_meta, **kwargs) TypeError: forward_train() missing 2 required positional arguments: 'gt_bboxes' and 'gt_labels'
Issue Analytics
- State:
- Created 4 years ago
- Comments:21 (2 by maintainers)
Top GitHub Comments
perhaps reduce learn rate will solve your problem
Thanks for reporting the bug.
There is no gt in
test_pipeline
which leads this error. Here is a temporary solution:val_pipiline
in the config:data.val.pipeline
:https://github.com/open-mmlab/mmdetection/blob/82c533bee0de1a84f5959e257815eb7df4e69162/configs/mask_rcnn_r50_fpn_1x.py#L156