rosinality / glow-pytorch

PyTorch implementation of Glow
MIT License
519 stars 96 forks source link

Tensor and Target size mismatch #8

Open Frndznz opened 5 years ago

Frndznz commented 5 years ago

When I try to train on one-channel images, there are dimension mismatches in the initialization of the forward function when using a 32x32 image custom dataset. I get the following error in line 39 of the model: The expanded size of the tensor (4) must match the existing size (12) at non-singleton dimension 1. Target sizes: [1, 4, 1, 1]. Tensor sizes: [1, 12, 1, 1] When trying to train on MNIST, there is an error when squeezing the input in line 273 of the model. I get the following error message: RuntimeError: shape '[32, 4, 3, 2, 3, 2]' is invalid for input of size 6272

lifeitech commented 4 years ago

When training on MNIST, setting n_block=2 is fine, but any block number higher than 2 would cause the error.