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

Error when running the command #5

Closed
Wazaki-Ou opened this issue May 24, 2018 · 10 comments
Closed

Error when running the command #5

Wazaki-Ou opened this issue May 24, 2018 · 10 comments

Comments

@Wazaki-Ou
Copy link

I tried to run the command for a test with the 2 pictures provided (I installed pytorch on Anaconda) and I got the following error:

Traceback (most recent call last):
  File "run.py", line 166, in <module>
    moduleNetwork = Network().cuda()
  File "run.py", line 133, in __init__
    self.moduleBasic = torch.nn.ModuleList([ Basic(intLevel) for intLevel in range(6) ])
  File "run.py", line 133, in <listcomp>
    self.moduleBasic = torch.nn.ModuleList([ Basic(intLevel) for intLevel in range(6) ])
  File "run.py", line 100, in __init__
    self.moduleBasic[intConv * 2].weight.data.copy_(torch.utils.serialization.load_lua('./models/modelL' + str(intLevel + 1) + '_' + arguments_strModel  + '-' + str(intConv + 1) + '-weight.t7'))
RuntimeError: The expanded size of the tensor (7) must match the existing size (0) at non-singleton dimension 3

Do you know what could be the reason for this ? thank you !!

@sniklaus
Copy link
Owner

Which version of PyTorch are you using?

@Wazaki-Ou
Copy link
Author

@sniklaus I am using 0.4.0
While looking for a solution, I found that many people had a similar issue (same runtimeerror) with this release. I will try to modify the lines like they suggested and see if it works. Meanwhile, any suggestion is very welcome. Thank you !!

@sniklaus
Copy link
Owner

I updated the code to 0.4.0 which might resolve this issue. Could you give it a try again?

@Wazaki-Ou
Copy link
Author

I tried again with the updated code but I keep getting the same error.

@sniklaus
Copy link
Owner

I am unfortunately not able to determine what is causing this issue. It apparently cannot load the weights from the pre-trained model, but that is all I can tell. Please keep us updated should you be able to resolve this issue. Thanks!

@Wazaki-Ou
Copy link
Author

I surely will. Thank you for your replies.

@Wazaki-Ou
Copy link
Author

Wazaki-Ou commented May 24, 2018

A friend also tried from his machine and he gets the same problem. This is a link to similar error that happens while using Yolo. I think it might indeed be a problem in PyTorch 0.4.0. Maybe it can help you understand the error.
https://github.com/marvis/pytorch-yolo2/issues/84
Meanwhile, would it be possible to make it work with previous versions of PyTorch? I will just downgrade mine to use spynet. Thanks again !!

@sniklaus
Copy link
Owner

I am surprised that I am not experiencing the same issue. How did you install PyTorch, from the sources or are you using pre-built binaries?

If you want to give version 0.3.1 of PyTorch a try, just make sure to use the commit from two months ago.

@Wazaki-Ou
Copy link
Author

I installed it through anaconda using conda install. Could it be a python related issue? I am using python 3.6. Sure I will give it a try and let you know !!

@sniklaus
Copy link
Owner

I am using the Anaconda build as well, I am using Python 3.5 though. While there are different pre-built PyTorch binaries for Python 3.5 and Python 3.6, I would be surprised if one of them shows this behavior and the other one doesn't.

@sniklaus sniklaus closed this as completed Jun 5, 2018
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