Issue with 'learn_initial_query=True' in RT-DETR: AttributeError on 'tile'

Hello everyone,

I’m relatively new to the Transformers library and I’ve encountered an issue while working with the RT-DETR model. Specifically, when I set learn_initial_query = True and attempt to run my code, I encounter the following error:

  File "./venv/lib/python3.12/site-packages/transformers/models/rt_detr/modeling_rt_detr.py", line 1858, in forward
    target = self.weight_embedding.tile([batch_size, 1, 1])
             ^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "./venv/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1729, in __getattr__
    raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'")
AttributeError: 'Embedding' object has no attribute 'tile'

It seems like the tile method is being called on an Embedding object, but according to the error message, this method doesn’t exist for that object.

I followed the example notebook and am using the Trainer to train the model. Could this be a bug in the modeling_rt_detr.py file, or is there something I might be missing in my setup?

Any help or insights would be greatly appreciated!

Thank you!

Please I still need help here!

Thanks, have pinged the team!