CSC2548/text2image2textGAN

Size mismatch

Closed this issue · 2 comments

Hi, when I run python3 runtime.py --cls --type=gan --epochs=100 --dataset=birds, it gives out the following error, do you know how to fix it? Thanks!

Traceback (most recent call last): | 0/429 [00:00<?, ?it/s]
File "runtime.py", line 52, in
trainer.train(args.cls, args.interp)
File "/trainer.py", line 135, in train
self._train_gan(cls, interp)
File "
/trainer.py", line 286, in _train_gan
fake_images = self.generator(right_embed, noise)
File "/lib/python3.6/site-packages/torch/nn/modules/module.py", line 493, in call
result = self.forward(*input, kwargs)
File "/lib/python3.6/site-packages/torch/nn/parallel/data_parallel.py", line 150, in forward
return self.module(*inputs[0], kwargs[0])
File "/lib/python3.6/site-packages/torch/nn/modules/module.py", line 493, in call
result = self.forward(*input, kwargs)
File "/models/gan_cls.py", line 118, in forward
projected_embed = self.projection(embed_vector).unsqueeze(2).unsqueeze(3)
File "
/lib/python3.6/site-packages/torch/nn/modules/module.py", line 493, in call
result = self.forward(*input, kwargs)
File "
/lib/python3.6/site-packages/torch/nn/modules/container.py", line 92, in forward
input = module(input)
File "/lib/python3.6/site-packages/torch/nn/modules/module.py", line 493, in call
result = self.forward(*input, kwargs)
File "/python3.6/site-packages/torch/nn/modules/linear.py", line 92, in forward
return F.linear(input, self.weight, self.bias)
File "
/lib/python3.6/site-packages/torch/nn/functional.py", line 1406, in linear
ret = torch.addmm(bias, input, weight.t())
RuntimeError: size mismatch, m1: [64 x 2400], m2: [228 x 128] at /opt/conda/conda-bld/pytorch_1556653099582/work/aten/src/THC/generic/THCTensorMathBlas.cu:268

nvm, solved.

hello, how do you solve it?