Skip to content

Open-Sora: Democratizing Efficient Video Production for All

Python

debug

Shen-Chenhuif0756dd7a6a8
diff --git a/opensora/models/vae/vae_3d_v2.py b/opensora/models/vae/vae_3d_v2.py
index 3e176ce..736062a 100644
--- a/opensora/models/vae/vae_3d_v2.py
+++ b/opensora/models/vae/vae_3d_v2.py
@@ -814,7 +814,7 @@ class VAE_3D_V2(nn.Module):
kl_loss = torch.mean(kl_loss) / kl_loss.shape[0]
# TODO: DOUBLE add more sophisticated discrminator loss
- gen_loss = self.zero
+ gen_loss = 0
if self.adversarial_loss_weight is not None and self.adversarial_loss_weight > 0:
if video_contains_first_frame:
# video_len = video.shape[2]
@@ -830,7 +830,7 @@ class VAE_3D_V2(nn.Module):
# perceptual loss
# SCH: NOTE: if mse can pick single frame, if use sum of errors, need to calc for all frames!
- perceptual_loss = self.zero
+ perceptual_loss = 0
if self.perceptual_loss_weight is not None and self.perceptual_loss_weight > 0:
frame_indices = torch.randn((batch, frames)).topk(1, dim = -1).indices