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

Using FP16,YoloX,softnms got RuntimeError: expected scalar type Float but found Half #6976

Closed
Klawens opened this issue Jan 10, 2022 · 7 comments · Fixed by #7324
Closed
Assignees
Labels
bug Something isn't working

Comments

@Klawens
Copy link

Klawens commented Jan 10, 2022

File "/home/lsc/mmdet-2.20/mmdet/models/detectors/base.py", line 174, in forward
return self.forward_test(img, img_metas, **kwargs)
File "/home/lsc/mmdet-2.20/mmdet/models/detectors/base.py", line 147, in forward_test
return self.simple_test(imgs[0], img_metas[0], **kwargs)
File "/home/lsc/mmdet-2.20/mmdet/models/detectors/single_stage.py", line 102, in simple_test
results_list = self.bbox_head.simple_test(
File "/home/lsc/mmdet-2.20/mmdet/models/dense_heads/base_dense_head.py", line 360, in simple_test
return self.simple_test_bboxes(feats, img_metas, rescale=rescale)
File "/home/lsc/mmdet-2.20/mmdet/models/dense_heads/dense_test_mixins.py", line 37, in simple_test_bboxes
results_list = self.get_bboxes(
File "/home/lsc/mmdet-2.20/mmdet/models/dense_heads/yolox_head.py", line 294, in get_bboxes
self._bboxes_nms(cls_scores, bboxes, score_factor, cfg))
File "/home/lsc/mmdet-2.20/mmdet/models/dense_heads/yolox_head.py", line 321, in bboxes_nms
dets, keep = batched_nms(bboxes, scores, labels, cfg.nms)
File "/home/lsc/anaconda3/envs/mmdet/lib/python3.8/site-packages/mmcv/ops/nms.py", line 340, in batched_nms
dets, keep = nms_op(boxes_for_nms[mask], scores[mask], **nms_cfg
)
File "/home/lsc/anaconda3/envs/mmdet/lib/python3.8/site-packages/mmcv/utils/misc.py", line 340, in new_func
output = old_func(*args, **kwargs)
File "/home/lsc/anaconda3/envs/mmdet/lib/python3.8/site-packages/mmcv/ops/nms.py", line 245, in soft_nms
dets, inds = SoftNMSop.apply(boxes.cpu(), scores.cpu(),
File "/home/lsc/anaconda3/envs/mmdet/lib/python3.8/site-packages/mmcv/ops/nms.py", line 88, in forward
inds = ext_module.softnms(
RuntimeError: expected scalar type Float but found Half

@Klawens Klawens changed the title Using YoloX softnms got RuntimeError: expected scalar type Float but found Half Using FP16,YoloX,softnms got RuntimeError: expected scalar type Float but found Half Jan 10, 2022
@RangiLyu RangiLyu added the bug Something isn't working label Jan 10, 2022
@RangiLyu
Copy link
Member

Thanks for your report! We will check it.

@vanche
Copy link

vanche commented Feb 21, 2022

Hi, do you have any updates? I have the same issue.

@chhluo
Copy link
Collaborator

chhluo commented Mar 4, 2022

Could you please provide the environment information, pkg information, and command to reproduce this error ?

@alaa-shubbak
Copy link

i still did not get the answer , i face the same issue while training my model on centriapetal_net,
with fp16 = dict(loss_scale='dynamic')

any solution for that?

@Klawens
Copy link
Author

Klawens commented Apr 22, 2022

I solve the problem by not using the YOLOX in mmdet, btw it's not mmdet's fault

@alaa-shubbak
Copy link

ng the YOLOX in mmdet, btw it's not mmdet's fault

but i am not using yolox as a training model , i used centriapetalNet

@jbwang1997
Copy link
Collaborator

Hello @alaa-shubbak. Thanks for your error report. This error should be fixed after mmdet 2.23. Could you check the version of mmdet you used?

Make sure that your mmdet version is greater than or equal to 2.23.0. If the error still occurs, you can open a new issue and provide the error report, config, and environment in the new issue. We will fix the error as soon as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants