dansuh17 / segan-pytorch

SEGAN pytorch implementation https://arxiv.org/abs/1703.09452
GNU General Public License v3.0
106 stars 32 forks source link

RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 1. #27

Closed haoxiangsnr closed 4 years ago

haoxiangsnr commented 5 years ago

Hello, I really like the implementation you wrote. I used the TIMIT and NoiseX92 to synthesize my own dataset, but at runtime, I am prompted with the following error:

  File "model.py", line 291, in forward
    encoded = torch.cat((c, z), dim=1)

RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 1. Got 32 and 3 in dimension 0 at /pytorch/aten/src/THC/generic/THCTensorMath.cu:83
dansuh17 commented 5 years ago

This is an error when the dimensions at 1 don't match (as the error message says...). The input size SHOULD be (B x 1 x 16384) and the latent vector z must have size (B x 1024 x 8) in order to train successfully. Please double-check if you have matched these conditions. The B stands for batch size.

haoxiangsnr commented 5 years ago

Ok, thank you for your prompt reply.