jinxixiang / magic_animate_unofficial

An unoffical training code of Magic Animate
Apache License 2.0
35 stars 5 forks source link

Calling clear before calculating the loss #14

Open junaidwahid opened 7 months ago

junaidwahid commented 7 months ago

Hello,

If I am not wrong, calling referencenet.clear() before calculating the loss is wrong . I think it will clear the gradients or information for the gradient calculation.

https://github.com/jinxixiang/magic_animate_unofficial/blob/a6f8c8d37cbc5c30a0c5950fb52d60d5b5cdf645/animatediff/magic_animate/pipeline.py#L993