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

TypeError: forward() got an unexpected keyword argument 'src_key_padding_mask' #3

Open
luozhiping opened this issue Jan 4, 2024 · 4 comments · May be fixed by #27
Open

TypeError: forward() got an unexpected keyword argument 'src_key_padding_mask' #3

luozhiping opened this issue Jan 4, 2024 · 4 comments · May be fixed by #27

Comments

@luozhiping
Copy link

param error use imitate_episodes.py to train model.

TypeError: forward() got an unexpected keyword argument 'src_key_padding_mask'
TypeError: forward() got an unexpected keyword argument 'pos'

at detr_vae.py line 116:          encoder_output = self.encoder(encoder_input, pos=pos_embed, src_key_padding_mask=is_pad)

where transformer.py forward function param is     
def forward(self, src, mask, query_embed, pos_embed, latent_input=None, proprio_input=None, additional_pos_embed=None)

Are there any code updated haven't pushed?

@luozhiping
Copy link
Author

change input param to self.encoder(encoder_input, pos_embed=pos_embed, mask=is_pad) and then got this error:
: forward() missing 1 required positional argument: 'query_embed'

@luozhiping
Copy link
Author

image

is there any wrong here? actually it should be encoder = build_encoder(args)

@apirrone
Copy link

apirrone commented Jan 4, 2024

Thanks @luozhiping

Did just that and it seems to be training now !

in detr/models/detr_vae.py at line 285 change build_transformer to build_encoder

@Ke-Wang1017
Copy link

Thanks @luozhiping

Did just that and it seems to be training now !

in detr/models/detr_vae.py at line 285 change build_transformer to build_encoder

This works for me as well!

@ZhenghaoFei ZhenghaoFei linked a pull request Jan 18, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

3 participants