MMaDA icon indicating copy to clipboard operation
MMaDA copied to clipboard

AttributeError: 'NoneType' object has no attribute 'to

Open kdywt opened this issue 1 year ago • 2 comments

The parameter "answer_lengths_lm" has no input.

Image

Image

Image

kdywt avatar Jun 04 '25 09:06 kdywt

Hi, thanks for your attention. I believe you can simply comment lines 267-268 in modeling_mmada.py for the first stage, where the language model part does not follow an instruction-following pattern. Alternatively, you can start your training with an instruction-following text dataset, and directly copy the lm part in train_mmada_stage2.py for your first stage training.

tyfeld avatar Jun 04 '25 10:06 tyfeld

I got the same error. why answer_lengths_lm does not exist in train_mmada_stage2.py?

MMaDA/models/modeling_mmada.py", line 267, in forward_process answer_lengths_lm = answer_lengths_lm.to(masked_indices_lm.device) ^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'to'

oiabtt avatar Jul 17 '25 16:07 oiabtt