Open-Sora: Democratizing Efficient Video Production for All
Python
debug
Shen-Chenhui6f460c1d0527
diff --git a/opensora/models/vae/model_utils.py b/opensora/models/vae/model_utils.pyindex 11aa52f..58eacfd 100644--- a/opensora/models/vae/model_utils.py+++ b/opensora/models/vae/model_utils.py@@ -302,7 +302,9 @@ class VEA3DLossWithPerceptualLoss(nn.Module):permutated_input.reshape(-1, data_shape[-3], data_shape[-2],data_shape[-1]).contiguous(),permutated_rec.reshape(-1, data_shape[-3], data_shape[-2],data_shape[-1]).contiguous())- rec_loss = rec_loss + self.perceptual_weight * p_loss+ # SCH: shape back p_loss+ permuted_p_loss = torch.permute(p_loss.reshape(data_shape[0], data_shape[1], 1, 1, 1), (0,2,1,3,4))+ rec_loss = rec_loss + self.perceptual_weight * permuted_p_lossnll_loss = rec_loss / torch.exp(self.logvar) + self.logvarweighted_nll_loss = nll_loss