MemoPainter-PyTorch icon indicating copy to clipboard operation
MemoPainter-PyTorch copied to clipboard

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

Open 04lm40 opened this issue 6 years ago • 2 comments

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.

04lm40 avatar Oct 07 '19 12:10 04lm40

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

dongheehand avatar Oct 12 '19 01:10 dongheehand

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.

04lm40 avatar Oct 12 '19 03:10 04lm40