Zhen-Dong / Magic-Me

Codes for ID-Specific Video Customized Diffusion
https://magic-me-webpage.github.io/
Apache License 2.0
465 stars 38 forks source link

loss nan bug #14

Open wade0604 opened 8 months ago

wade0604 commented 8 months ago

loss = loss.sum([1,2,3,4])/masks.sum([1,2,3,4]) if masks.sum([1,2,3,4]) contains 0, then the loss will be NaN so i simply change the upper code to loss = loss.sum([1,2,3,4])/(masks.sum([1,2,3,4])+1e-6), Is this appropriate?