pixeli99 / SVD_Xtend

Stable Video Diffusion Training Code and Extensions.
553 stars 51 forks source link

AttributeError: 'UNetSpatioTemporalConditionModel' object has no attribute 'module'. Did you mean: 'modules'? #2

Closed BlakeOne closed 8 months ago

BlakeOne commented 8 months ago

Hey there, I'm trying out your new training script but I get this error... I'm using stabilityai/stable-video-diffusion-img2vid for the pretrained_model_name_or_path BTW but I'm not sure if that's correct?

AttributeError: 'UNetSpatioTemporalConditionModel' object has no attribute 'module'. Did you mean: 'modules'?

pixeli99 commented 8 months ago

https://github.com/pixeli99/SVD_Xtend/blob/64c9783a8fabaedab6e4a667abe2d44629e62579/train_svd.py#L940

change to

passed_add_embed_dim = unet.config.addition_time_embed_dim * len(add_time_ids)
expected_add_embed_dim = unet.add_embedding.linear_1.in_features

You just need to delete these two lines of modules, it's due to the unfriendliness on my code because I'm using multi-GPU training, and this problem occurs under ddp mode. If you are using a single GPU, you can simply delete them.

BlakeOne commented 8 months ago

Thanks removing those lines fixed it for me. :)