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

/torch/install/share/lua/5.1/nn/LookupTable.lua:59: attempt to call method 'Contiguous' (a nil value) #1301

Open
jmfu95 opened this issue Jan 2, 2018 · 0 comments

Comments

@jmfu95
Copy link

jmfu95 commented Jan 2, 2018

I want to combine two loss, softmax and kl. So i use the following code:
local nll = nn.ClassNLLCriterion()
local kl = nn.DistKLDivCriterion()
local criterion = nn.ParallelCriterion():add(nll,0.5):add(kl)
and the input is:
{
1 : IntTensor - size: 75x24
2 : IntTensor - size: 75x24
}
output is:
{
1 : IntTensor - size: 75x1
2 : DoubleTensor - size: 75x6
}
But when i run this module, i get the following error:
/torch/install/share/lua/5.1/nn/LookupTable.lua:59: attempt to call method 'Contiguous' (a nil value)
stack traceback:
...shedongyu/torch/install/share/lua/5.1/nn/LookupTable.lua:59: in function 'makeInputContiguous'
...shedongyu/torch/install/share/lua/5.1/nn/LookupTable.lua:72: in function 'func'
...hedongyu/torch/install/share/lua/5.1/nngraph/gmodule.lua:345: in function 'neteval'
...hedongyu/torch/install/share/lua/5.1/nngraph/gmodule.lua:380: in function 'forward'
./trainer.lua:75: in function 'opfunc'
...shedongyu/torch/install/share/lua/5.1/optim/adadelta.lua:31: in function 'optim_method'
./trainer.lua:104: in function 'train'
main.lua:215: in function 'train_loop'
main.lua:407: in function 'main'
main.lua:420: in main chunk
[C]: in function 'dofile'
...ngyu/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
[C]: at 0x00406670
I tried, but i can't fix this. Someone knows where the mistake is. Is the input wrong?

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

1 participant