-
Notifications
You must be signed in to change notification settings - Fork 5
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
torch/install/bin/luajit: bad argument #3 to '?' (number expected, got userdata) #3
Comments
Do not use nn.Reshape, since it does not allow for dynamic reshaping. Just use torch.reshape to get the outputs and inputs into the same shape. The last few elements in the input do not matter, and is just padding. It should be okay to simply remove them so the input and gradOutput are the same size. |
Hi,
but i got this error do you have a specific number for the input and the output shape?? or it is dynamic? if it is dynamic how I make it dynamic here too? |
hi |
Hi,
I post previously about issue( input and gradOutput shapes do not match), and you recommended me install specific torch with Cuda 5 or 6. I did it, but it didn't workout unfortunately. Then i try your second recommendation to reshape the data in spatial pleases and i try as below:(trainer.lua)
this time it gave me this error:
/torch/install/bin/luajit: bad argument #3 to '?' (number expected, got userdata)
stack traceback:
[C]: at 0x7fa0ce476830
[C]: in function '__newindex'
/home/shayan/torch/install/share/lua/5.1/nn/Reshape.lua:19: in function '__init'
/home/shayan/torch/install/share/lua/5.1/torch/init.lua:91: in function </home/shayan/torch/install/share/lua/5.1/torch/init.lua:87>
[C]: in function 'Reshape'
./Trainer.lua:71: in function 'opfunc'
/home/shayan/torch/install/share/lua/5.1/optim/sgd.lua:44: in function 'optimMethod'
./Trainer.lua:111: in function 'train'
main.lua:93: in function 'main'
main.lua:126: in main chunk
[C]: in function 'dofile'
...ayan/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
[C]: at 0x00405d50
Asking for input shape numbers. I don't know the input shape number. Moreover, I read the code, and I didn't get where is the input shape. The only thing I am sure of is the input always greater than the gradOutput by one or tow numbers as you can see from errors below :
5.1/nn/THNN.lua:110: input and gradOutput shapes do not match: input [524 x 2], gradOutput [522 x 2]
5.1/nn/THNN.lua:110: input and gradOutput shapes do not match: input [162 x 2], gradOutput [161 x 2]
5.1/nn/THNN.lua:110: input and gradOutput shapes do not match: input [566 x 2], gradOutput [564 x 2]
5.1/nn/THNN.lua:110: input and gradOutput shapes do not match: input [254 x 2], gradOutput [253 x 2]
But no specific number
Can you help me to solve this problem. I am trying to find other solution but I am new to torch and lua (To be onset I am learning them just for your code ). I am studying a lot of tutorials but i didn't get all your code yet.
Thanks in advance.
The text was updated successfully, but these errors were encountered: