open-mmlab / mmdetection

OpenMMLab Detection Toolbox and Benchmark
https://mmdetection.readthedocs.io
Apache License 2.0
29.07k stars 9.37k forks source link

About deformable detr #6082

Open kx-Z opened 3 years ago

kx-Z commented 3 years ago

RuntimeError: "ms_deform_attn_forward_cuda" not implemented for 'Half'

Does deformable detr not support fp16?

jshilong commented 3 years ago

We do not support this feature at the moment

ZwwWayne commented 3 years ago

We do not support this feature at the moment

Actually, we can use the branch of pure PyTorch implementation for FP16 feature.

guillaumefrd commented 2 years ago

Any update on this?

Dawn-bin commented 2 years ago

Can I implement 'ms_deform_attn_forward_cuda' part to fp32 alone? And how to do this?

wwwbq commented 2 years ago

Any update on this?

guillaumefrd commented 2 years ago

Can I implement 'ms_deform_attn_forward_cuda' part to fp32 alone? And how to do this?

You can force the forward of deformable DETR to be fp32 by adding @force_fp32() on top of the forward definition.

Tamiku commented 2 years ago

Can I implement 'ms_deform_attn_forward_cuda' part to fp32 alone? And how to do this?

You can force the forward of deformable DETR to be fp32 by adding @force_fp32() on top of the forward definition.

hi,I met the same problem now and I'm noob in mmdet. Can you tell me which file did you change? I tried to change mask2former_head.py in models/densehead but it didn't works. Thank you!

Dawn-bin commented 2 years ago

Can I implement 'ms_deform_attn_forward_cuda' part to fp32 alone? And how to do this?

You can force the forward of deformable DETR to be fp32 by adding @force_fp32() on top of the forward definition.

hi,I met the same problem now and I'm noob in mmdet. Can you tell me which file did you change? I tried to change mask2former_head.py in models/densehead but it didn't works. Thank you!

hi, I find that It doesn't work. I suggest to use PyTorch implementation. '@force_fp32' maybe only force input param of function to be fp32. Dose Someone else have a better solution?