MarkFzp / act-plus-plus

Imitation learning algorithms with Co-training for Mobile ALOHA: ACT, Diffusion Policy, VINN
https://mobile-aloha.github.io/
MIT License
2.93k stars 543 forks source link

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

Open luozhiping opened 8 months ago

luozhiping commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

image

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

apirrone commented 8 months ago

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 commented 8 months ago

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!

3030712382 commented 1 month ago

图像

这里有什么错误吗?实际上应该是encoder = build_encoder(args)

Thank you!That's right for me!