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

cpu version of SpatialCrossEntropyCriterion() #367

Open
varghesealex90 opened this issue May 23, 2017 · 0 comments
Open

cpu version of SpatialCrossEntropyCriterion() #367

varghesealex90 opened this issue May 23, 2017 · 0 comments

Comments

@varghesealex90
Copy link

I would like to run a fully convolution neural network with SpatialCrossEntropy as criteria. Does a cpu version of the same exists?

require 'cudnn'
require 'cunn'
require 'nn'
model=nn.Sequential()
model:add(nn.SpatialConvolutionMM(3,2,3,3,1,1,1,1))
model:add(nn.SpatialLogSoftMax())
a= torch.Tensor(2,3,5,5)
b=torch.Tensor(2,5,5):fill(1)
c= model:forward(a)
criterio= cudnn.SpatialCrossEntropyCriterion()
err= criterio:forward(c,b)

Error:
/home/brats/torch/install/bin/luajit: /home/brats/torch/install/share/lua/5.1/cudnn/init.lua:168: assertion failed!
stack traceback:
[C]: in function 'assert'
/home/brats/torch/install/share/lua/5.1/cudnn/init.lua:168: in function 'toDescriptor'
...ats/torch/install/share/lua/5.1/cudnn/SpatialSoftMax.lua:39: in function 'createIODescriptors'
...ats/torch/install/share/lua/5.1/cudnn/SpatialSoftMax.lua:57: in function 'updateOutput'
...all/share/lua/5.1/cudnn/SpatialCrossEntropyCriterion.lua:31: in function 'forward'
cpu.lua:22: in main chunk
[C]: in function 'dofile'
...rats/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: at 0x00406670

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