fundamentalvision / Deformable-DETR

Deformable DETR: Deformable Transformers for End-to-End Object Detection.
Apache License 2.0
3.14k stars 513 forks source link

Tracing the Deformable Attention Module #208

Open Mona77 opened 1 year ago

Mona77 commented 1 year ago

I was trying to trace my model using traced_cell = torch.jit.trace(model, (x)):

Could not export Python function call 'MSDeformAttnFunction'. Remove calls to Python functions before export. Did you forget to add @script or @script_method annotation? If this is a nn.ModuleList, add it to __constants__:

Any recommendations on how to change CUDA implementation of Deformable Attention Module to be able to trace the model?

Zalways commented 1 year ago

have you resolved this problem? i also encountered some problem while export the model to torchscript model in order to deploy with c++,maybe we can have a talk to solve our problem(i had export the model successfully,but have some problem in deploy)