[RT-Detr] - Add RT-Detr Onnx Config
What does this PR do?
- Add RT-Detr Onnx config to optimum from this PR in transformers : https://github.com/huggingface/transformers/pull/33877
Fixes # (issue)
Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [ ] Did you make sure to update the documentation with your changes?
- [ ] Did you write any new necessary tests?
Who can review?
Hi @fxmarty, @echarlaix, @JingyaHuang, @michaelbenayoun,
I'm creating this PR following @qubvel and @ArthurZucker advices on that PR: https://github.com/huggingface/transformers/pull/33877
Hi @echarlaix, thanks for the review!
I added "PekingU/rtdetr_r18vd" for testing, but I saw that you used hf-internal-testing. Should I create a random initiated model their ?
Hi @echarlaix, what are your insights ? I made the changes but should I create a random initiated model in hf-internal-testing ?
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
Apologies for the delay @YHallouard, just fixed the conflicts so that we can soon merge. Two things must be fixed before we can merge :
- it seems that the height / width used for export needs to have a minimum size (won't work with default value 64) failing at https://github.com/huggingface/transformers/blob/deac971c469bcbb182c2e52da0b82fb3bf54cccf/src/transformers/models/rt_detr/modeling_rt_detr.py#L1900 as we need
enc_outputs_class.shape[1] >= config.num_queries: can be fixed by overwriting_create_dummy_input_generator_classesand give an appropriate default value forheightandwidth(+ raising an error if value not correctly provided) - it seems
pixel_maskis considered as a constant during export and thus removed from the graph inputs
Looks like this task got stuck, do you need any help on it? Would be really great to have RT-DETR exporter for onnx.
Closed with https://github.com/huggingface/optimum/pull/2201