Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I already cropped image to 256*176,but still get dimension error , please help #84

Open
tsbiosky opened this issue Jul 18, 2020 · 3 comments

Comments

@tsbiosky
Copy link

python test.py --dataroot ./dataset --name fashion_PATN --model PATN --phase test --dataset_mode keypoint --norm instance --batchSize 1 --resize_or_crop no --gpu_ids 0 --BP_input_nc 18 --no_flip --which_model_netG PATN --checkpoints_dir ./checkpoints/DeepFashion/ --pairLst ./dataset/pair.csv --which_epoch latest --results_dir ./results --display_id 0

Traceback (most recent call last):
File "test.py", line 39, in
model.test()
File "/media/roman/storage/Pose-Transfer/models/PATN.py", line 120, in test
self.fake_p2 = self.netG(G_input)
File "/home/roman/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/media/roman/storage/Pose-Transfer/models/model_variants.py", line 166, in forward
return nn.parallel.data_parallel(self.model, input, self.gpu_ids)
File "/home/roman/anaconda3/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 204, in data_parallel
return module(*inputs[0], **module_kwargs[0])
File "/home/roman/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/media/roman/storage/Pose-Transfer/models/model_variants.py", line 149, in forward
x1, x2, _ = model(x1, x2)
File "/home/roman/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/media/roman/storage/Pose-Transfer/models/model_variants.py", line 64, in forward
x1_out = x1_out * att
RuntimeError: The size of tensor a (64) must match the size of tensor b (16) at non-singleton dimension 3

@jessemelpolio
Copy link
Collaborator

From your provided information, I think most probably, the heat map of the pose that you fed is with the incorrect size. Please have a check.

@akhil451
Copy link

What is the required dimension of the pose heatmap and how to check the same?

@akhil451
Copy link

Image input is of the shape w=176,h=256, but unable to perform inference. getting the same error as above.
RuntimeError: The size of tensor a (64) must match the size of tensor b (44) at non-singleton dimension 3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants