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

The size of tensor a (16) must match the size of tensor b (4) at non-singleton dimension 0 #2

Open
04lm40 opened this issue Oct 7, 2019 · 2 comments

Comments

@04lm40
Copy link

04lm40 commented Oct 7, 2019

Hello, I met a problem while running,“The size of tensor a (16) must match the size of tensor b (4) at non-singleton dimension 0.” How can I solve it? thank you.

@dongheehand
Copy link
Owner

Please let me know the command you used. It will be helpful!

@04lm40
Copy link
Author

04lm40 commented Oct 12, 2019

When I run the "### Color feature : color distribution For pokemon
python main.py --color_info dist --color_feat_dim 313 --mem_size 982 --top_k 256 --train_data_path ./pokemon --test_data_path ./test_pokemon --alpha 0.3 --color_thres 0.5 --epoch 100
"
Error is "Traceback (most recent call last):
File "/MemoPainter-PyTorch-master/main.py", line 45, in
train(args)
File "/MemoPainter-PyTorch-master/mode.py", line 73, in train
loss = mem.unsupervised_loss(res_feature, color_feat, args.color_thres)
File "/MemoPainter-PyTorch-master/memory_network.py", line 66, in unsupervised_loss
color_similarity = self.KL_divergence(color_value_expand, color_feat_expand, 1)
File "/MemoPainter-PyTorch-master/memory_network.py", line 140, in KL_divergence
log_val = torch.log10(torch.div(a, b))
RuntimeError: The size of tensor a (16) must match the size of tensor b (4) at non-singleton dimension 0"
Thank you for your answer.

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

2 participants