Fewshot_Detection icon indicating copy to clipboard operation
Fewshot_Detection copied to clipboard

RuntimeError: The size of tensor a (3) must match the size of tensor b (864) at non-singleton dimension 3

Open edlawson opened this issue 2 years ago • 5 comments

I'm having some issues running train_meta. Specifically, I get the above error. All messages are:

~/Fewshot_Detection$ python train_meta.py cfg/metayolo.data cfg/darknet_dynamic.cfg cfg/reweighting_net.cfg darknet19_448.conv.23 /home/elawson/Fewshot_Detection/data/coco.names save_interval 10 ['bird', 'bus', 'cow', 'motorbike', 'sofa'] base_ids [0, 1, 3, 4, 6, 7, 8, 10, 11, 12, 14, 15, 16, 18, 19] logging to backup/metayolo_novel0_neg1 class_scale 1 Traceback (most recent call last): File "train_meta.py", line 87, in model.load_weights(weightfile) File "/home/elawson/Fewshot_Detection/darknet_meta.py", line 378, in load_weights start = load_conv_bn(buf, start, model[0], model[1]) File "/home/elawson/Fewshot_Detection/cfg.py", line 455, in load_conv_bn conv_model.weight.data.copy_(torch.from_numpy(buf[start:start+num_w])); start = start + num_w RuntimeError: The size of tensor a (3) must match the size of tensor b (864) at non-singleton dimension 3

Suggestions?

edlawson avatar Mar 04 '22 19:03 edlawson

hello, have you fixed it yet? I met the same problem

WqxLoveCoding avatar Mar 06 '22 04:03 WqxLoveCoding

hello, have you fixed it yet? I met the same problem

fish-kong avatar Mar 09 '22 09:03 fish-kong

hello, have you fixed it yet? I met the same problem

2563895797 avatar Apr 18 '22 14:04 2563895797

https://github.com/bingykang/Fewshot_Detection/issues/7#issuecomment-753658247 I followed this method and it worked, you can try it

xyqqqfs avatar Apr 29 '22 01:04 xyqqqfs

TypeError: only integer tensors of a single element can be converted to an index Have you met this problem?

STSTERANDMOMO avatar Mar 19 '23 11:03 STSTERANDMOMO