-
Notifications
You must be signed in to change notification settings - Fork 110
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
RuntimeError: The expanded size of the tensor (3) must match the existing size (864) at non-singleton dimension 3. Target sizes: [32, 3, 3, 3]. Tensor sizes: [864] #7
Comments
The folder "backup" is created manually. Is that right? |
Yes. |
Hi, thank you for your quickly reply. But I haven't solved the error mentioned above till now. Is it related with Broadcasting semantics in Pytorch? Thanks a lot. |
Are you using the cfg files in the instruction? |
Yes, I use cfg files and change the path of train set and val set. |
Maybe you can refer to this. |
Thank you for your opinions. I have tried these methods mentioned in the link above but solutions didn't work.My torch version is 1.3.0. |
Our code is implemented with PyTorch 0.3.1 and Python 2.7. You may want to try this version. |
Thank you for your suggestion! I think I should try it. |
I had the same issue, so I switched to PyTorch 0.3.1 but now I get
@DL-Alva Were you able to resolve the error with the The expanded size of the tensor (3) ? if yes, how and what version of Torch did you end up using? |
This ended up working, although not sure what I did to resolve the issue. I did install torchvision==0.4.2, and installed torch 0.4.0 then reinstalled torch 0.3.1. |
torch==0.3.1, python2.7, torchvision==0.2.0 work |
这个问题我觉得可以修改,cfg.py第456行.copy_()如下: copy_()复制和被复制的shape不一样,所有如果改了应该就可以。但是,我还遇到其他一些问题,或许换了pytorch的版本能解决问题! |
Have you solved this problem? @DL-Alva @90000mileswind |
Same errors. I use cuda8, pytorch 0.3.1, python 2.7 and torchvision 0.2.0. |
@90000mileswind |
Hello, can you tell me the CUDA version you used in the test? |
It is OK using pytorch0.3.1-py2.7 |
Open
worked for me |
|
Sorry for troubling you. When I run train_meta.py and load weightfile, a runtimeerror occured:
logging to backup/metayolo_novel0_neg1
class_scale 1
RuntimeErrorTraceback (most recent call last)
in ()
14 region_loss = model.loss
15
---> 16 model.load_weights(weightfile)
17 model.print_network()
~/lkj项目/FSD_yolo/darknet_meta.py in load_weights(self, weightfile)
376 batch_normalize = int(block['batch_normalize'])
377 if batch_normalize:
--> 378 start = load_conv_bn(buf, start, model[0], model[1])
379 else:
380
~/lkj项目/FSD_yolo/cfg.py in load_conv_bn(buf, start, conv_model, bn_model)
453 bn_model.running_mean.copy_(torch.from_numpy(buf[start:start+num_b])); start = start + num_b
454 bn_model.running_var.copy_(torch.from_numpy(buf[start:start+num_b])); start = start + num_b
--> 455 conv_model.weight.data.copy_(torch.from_numpy(buf[start:start+num_w])); start = start + num_w
456 return start
457
RuntimeError: The expanded size of the tensor (3) must match the existing size (864) at non-singleton dimension 3. Target sizes: [32, 3, 3, 3]. Tensor sizes: [864]
Do you know what's wrong with this? Thank you so much.
The text was updated successfully, but these errors were encountered: