ChenFengYe / motion-latent-diffusion

[CVPR 2023] Executing your Commands via Motion Diffusion in Latent Space, a fast and high-quality motion diffusion model
https://chenxin.tech/mld/
MIT License
586 stars 55 forks source link

ValueError: Expected parameter loc (Tensor of shape (1, 64, 256)) of distribution Normal(loc: torch.Size([1, 64, 256]), scale: torch.Size([1, 64, 256])) to satisfy the constraint Real() #21

Closed borishanzju closed 1 year ago

borishanzju commented 1 year ago

I have an error:

ValueError: Expected parameter loc (Tensor of shape (1, 64, 256)) of distribution Normal(loc: torch.Size([1, 64, 256]), scale: torch.Size([1, 64, 256])) to satisfy the constraint Real(), but found invalid values: tensor([[[ 0.6326, 0.4567, 0.2685, ..., -0.0168, -0.4774, -0.0232], [ 0.5023, 0.5330, 0.1182, ..., -0.2443, -0.3375, -0.0431], [ 0.2148, 0.4916, 0.0980, ..., -0.4056, -0.6656, -0.7602], ..., [ 0.3467, 0.4580, -0.0513, ..., -0.4357, -0.4237, -0.2290], [ 0.2697, 0.4110, -0.0073, ..., -0.4484, -0.4857, -0.4882], [ 0.2831, 0.4207, -0.0059, ..., -0.5405, -0.4745, -0.3016]]], device='cuda:0')

I see it in mld.models.architectures.mld_vae.py. And it appears in line 183. Because std must positive, but there are some negative number.

And I think the reaseon is the self.global_motion_token = nn.Parameter(torch.randn(self.latent_size, self.latent_dim)). torch.randn will give some positive and negative number obeying the gaussian distribution