guoqincode / Open-AnimateAnyone

Unofficial Implementation of Animate Anyone
2.89k stars 233 forks source link

AttributeError: ‘PoseGuider’ object has no attribute ‘module’. #48

Closed saidkaban closed 8 months ago

saidkaban commented 8 months ago

Thanks for sharing this repo @guoqincode.

While trying to run stage 2 training, getting this error: AttributeError: ‘PoseGuider’ object has no attribute ‘module’. Did you mean: ‘modules’? on line 550 in file train.py.

Do you happen to know why I might be getting this error?

guoqincode commented 8 months ago

In stage2, poseguider does not warp using DDP and does not require training, so you do not need to save him.

lbwang2006 commented 8 months ago

Thanks for sharing this repo @guoqincode.

While trying to run stage 2 training, getting this error: AttributeError: ‘PoseGuider’ object has no attribute ‘module’. Did you mean: ‘modules’? on line 550 in file train.py.

Do you happen to know why I might be getting this error?

hi do you use the tiktok or ubc dataset in the code? I met troubles that very low gpu utilization with multi-gpu training ?

saidkaban commented 8 months ago

Thanks for sharing this repo @guoqincode. While trying to run stage 2 training, getting this error: AttributeError: ‘PoseGuider’ object has no attribute ‘module’. Did you mean: ‘modules’? on line 550 in file train.py. Do you happen to know why I might be getting this error?

hi do you use the tiktok or ubc dataset in the code? I met troubles that very low gpu utilization with multi-gpu training ?

Used tiktok dataset

saidkaban commented 8 months ago

Worked fine after removing poseguider in second training stage 🙏🏼

linxiang4200 commented 8 months ago

Worked fine after removing poseguider in second training stage 🙏🏼在第二个训练阶段移除poseguider后效果很好🙏🏼

I got the same error, do you edit the save model code? I modified the code to save the model like below and it no longer reports an error, but I don't know if this is correct

if is_main_process and global_step % checkpointing_steps == 0 :
    save_path = os.path.join(output_dir, f"checkpoints")
    state_dict = {
        "epoch": epoch,
        "global_step": global_step,
        "unet_state_dict": unet.state_dict(),
        # "poseguider_state_dict": poseguider.module.state_dict(),
        "referencenet_state_dict": referencenet.state_dict(),
    }

Also,how did you remove poseguider in second training stage? Did you comment the training code like this?

unet.train()
# poseguider.train()
referencenet.train()