Skip to content
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

rtmdet-ins training error :TypeError: loss_by_feat() takes from 5 to 6 positional arguments but 7 were given #881

Open
3 tasks done
W-hary opened this issue Sep 14, 2023 · 8 comments

Comments

@W-hary
Copy link

W-hary commented Sep 14, 2023

Prerequisite

🐞 Describe the bug

Install and successfully run the demo test according to ‘15_minutes_instance_segmentation.md‘.
An error occurred when training the balloon data set using ‘rtmdet-ins_s_syncbn_fast_8xb32-300e_coco.py’

python tools/train.py configs/rtmdet/rtmdet-ins_s_syncbn_fast_8xb32-300e_coco.py

Traceback (most recent call last):
File "tools/train.py", line 123, in
main()
File "tools/train.py", line 119, in main
runner.train()
File "/root/miniconda3/lib/python3.8/site-packages/mmengine/runner/runner.py", line 1745, in train
model = self.train_loop.run() # type: ignore
File "/root/miniconda3/lib/python3.8/site-packages/mmengine/runner/loops.py", line 96, in run
self.run_epoch()
File "/root/miniconda3/lib/python3.8/site-packages/mmengine/runner/loops.py", line 112, in run_epoch
self.run_iter(idx, data_batch)
File "/root/miniconda3/lib/python3.8/site-packages/mmengine/runner/loops.py", line 128, in run_iter
outputs = self.runner.model.train_step(
File "/root/miniconda3/lib/python3.8/site-packages/mmengine/model/base_model/base_model.py", line 114, in train_step
losses = self._run_forward(data, mode='loss') # type: ignore
File "/root/miniconda3/lib/python3.8/site-packages/mmengine/model/base_model/base_model.py", line 340, in _run_forward
results = self(**data, mode=mode)
File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "/root/miniconda3/lib/python3.8/site-packages/mmdet/models/detectors/base.py", line 92, in forward
return self.loss(inputs, data_samples)
File "/root/miniconda3/lib/python3.8/site-packages/mmdet/models/detectors/single_stage.py", line 78, in loss
losses = self.bbox_head.loss(x, batch_data_samples)
File "/root/autodl-tmp/mmyolo/mmyolo/models/dense_heads/yolov5_head.py", line 470, in loss
losses = self.loss_by_feat(*loss_inputs)
TypeError: loss_by_feat() takes from 5 to 6 positional arguments but 7 were given

Environment

PyTorch 1.11.0
Python 3.8(ubuntu20.04)
Cuda 11.3

Additional information

No response

@collinmccarthy
Copy link

This is indirectly because loss_by_feat() isn't implemented for the instance segmentation head. That is, instance segmentation is only supported currently for inference. I don't think it is that difficult to implement this function (you can look at the YOLOv5 detection vs. instance seg versions, and then the RTMDet detection version) but I haven't tried to get it working yet.

If I get it working I'll submit a PR, but I'm not sure when that will be.

Related to #649, #853

@confusedgreenhand
Copy link

Hi, I would like to ask if this problem has been solved

@rbli-john
Copy link

rbli-john commented Oct 29, 2023

Same question. Look forward to seeing the fast training for Rtmdet-ins

@jslok
Copy link

jslok commented Feb 7, 2024

No update on this?

Am I correct in assuming rtmdet-ins on mmdetection is the same as on mmyolo anyways but just slower training?

One difference I found is mmdeploy only offers deployment to Core ML with segmentation through mmseg.

@collinmccarthy
Copy link

collinmccarthy commented Feb 7, 2024 via email

@jslok
Copy link

jslok commented Feb 7, 2024

Mmdet supports training and inference on rtmdet-ins

@HanTnx
Copy link

HanTnx commented Apr 11, 2024

Mmdet supports training and inference on rtmdet-ins

can you provide more information about configuration of mmdet, mmcv, and related mmyolo version ? Thank you

@lijoe123
Copy link

The same error with the yolov8_ins, could you please tell me how to fix the problem #636

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants