A problem: assert pred.size() == target.size() and target.numel() > 0
See original GitHub issue2019-04-22 12:37:47,627 - INFO - Epoch [6][150/441] lr: 0.02000, eta: 1:00:51, time: 0.600, data_time: 0.008, memory: 3381, loss_rpn_cls: 0.0117, loss_rpn_reg: 0.0094, loss_cls: 0.1055, acc: 96.7344, loss_reg: 0.0567, loss: 0.1834 ^@2019-04-22 12:38:17,495 - INFO - Epoch [6][200/441] lr: 0.02000, eta: 0:59:10, time: 0.597, data_time: 0.008, memory: 3381, loss_rpn_cls: 0.0113, loss_rpn_reg: 0.0107, loss_cls: 0.1067, acc: 96.5859, loss_reg: 0.0580, loss: 0.1868 Traceback (most recent call last): File "./tools/train.py", line 90, in <module> main() File "./tools/train.py", line 86, in main logger=logger) File "/1t_second/lzw2/tools/anaconda3/lib/python3.7/site-packages/mmdet-0.6.0+5970e13-py3.7.egg/mmdet/apis/train.py", line 57, in train_detector _dist_train(model, dataset, cfg, validate=validate) File "/1t_second/lzw2/tools/anaconda3/lib/python3.7/site-packages/mmdet-0.6.0+5970e13-py3.7.egg/mmdet/apis/train.py", line 96, in _dist_train runner.run(data_loaders, cfg.workflow, cfg.total_epochs) File "/1t_second/lzw2/tools/anaconda3/lib/python3.7/site-packages/mmcv-0.2.6-py3.7.egg/mmcv/runner/runner.py", line 355, in run epoch_runner(data_loaders[i], **kwargs) File "/1t_second/lzw2/tools/anaconda3/lib/python3.7/site-packages/mmcv-0.2.6-py3.7.egg/mmcv/runner/runner.py", line 261, in train self.model, data_batch, train_mode=True, **kwargs) File "/1t_second/lzw2/tools/anaconda3/lib/python3.7/site-packages/mmdet-0.6.0+5970e13-py3.7.egg/mmdet/apis/train.py", line 37, in batch_processor losses = model(**data) File "/1t_second/lzw2/tools/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 489, in __call__ result = self.forward(*input, **kwargs) File "/1t_second/lzw2/tools/anaconda3/lib/python3.7/site-packages/mmcv-0.2.6-py3.7.egg/mmcv/parallel/distributed.py", line 50, in forward return self.module(*inputs[0], **kwargs[0]) File "/1t_second/lzw2/tools/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 489, in __call__ result = self.forward(*input, **kwargs) File "/1t_second/lzw2/tools/anaconda3/lib/python3.7/site-packages/mmdet-0.6.0+5970e13-py3.7.egg/mmdet/models/detectors/base.py", line 84, in forward return self.forward_train(img, img_meta, **kwargs) File "/1t_second/lzw2/tools/anaconda3/lib/python3.7/site-packages/mmdet-0.6.0+5970e13-py3.7.egg/mmdet/models/detectors/two_stage.py", line 150, in forward_train *bbox_targets) File "/1t_second/lzw2/tools/anaconda3/lib/python3.7/site-packages/mmdet-0.6.0+5970e13-py3.7.egg/mmdet/models/bbox_heads/bbox_head.py", line 107, in loss avg_factor=bbox_targets.size(0)) File "/1t_second/lzw2/tools/anaconda3/lib/python3.7/site-packages/mmdet-0.6.0+5970e13-py3.7.egg/mmdet/core/loss/losses.py", line 99, in weighted_smoothl1 loss = smooth_l1_loss(pred, target, beta, reduction='none') File "/1t_second/lzw2/tools/anaconda3/lib/python3.7/site-packages/mmdet-0.6.0+5970e13-py3.7.egg/mmdet/core/loss/losses.py", line 82, in smooth_l1_loss assert pred.size() == target.size() and target.numel() > 0 AssertionError
it’s trained successfully during first 5 epochs , but problem occurs at 6th epoch. Thank you in advance
Issue Analytics
- State:
- Created 4 years ago
- Comments:7
Top GitHub Comments
Hello @lzewhard , I also encountered this problem today. I checked that the category_id is all start from 1. Could you please show me more details of your solution? Thank you in advance.
solved, label class starts from 1, 0 for background