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

Potential bug in the transformer.py and detr_vae.py? #25

Open
Facebear-ljx opened this issue Apr 23, 2024 · 1 comment
Open

Potential bug in the transformer.py and detr_vae.py? #25

Facebear-ljx opened this issue Apr 23, 2024 · 1 comment

Comments

@Facebear-ljx
Copy link

Hi, thanks for the amazing work! Recently, I tried to reimplement your code. However, I found something strange.

Especially, the forward of Transformer class in transformer.py only returns hs,which is a tensor with shape [Decoder block num, B, num_query, C]:

However, in detr_vae.py, the action_head uses only hs[0] as input. This means the action is predicted based only on the first decorder feature with shape [1, B, num_query, C], but ignores all the other following features:

hs = self.transformer(src, None, self.query_embed.weight, pos, latent_input, proprio_input, self.additional_pos_embed.weight)[0]

hs = self.transformer(transformer_input, None, self.query_embed.weight, self.pos.weight)[0]

So, this is strange for me and I wonder if this is a bug. Hoping for your reply! Thanks in advance~

@Facebear-ljx
Copy link
Author

I checked the official DETR code and found the transfomer in DETR returns a tuple [hs, memory]:

https://github.com/facebookresearch/detr/blob/29901c51d7fe8712168b8d0d64351170bc0f83e0/models/transformer.py#L59

So, hs[0] in their code uses all intermediate features rather than the first decorder feature.

JINXER000 pushed a commit to JINXER000/act_interleaved that referenced this issue Sep 19, 2024
Added gravity comp mounts, and updated wrist cam mounts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant