Can't convert a model from CUDA with a nn.SpatialMaxPooling

12 views
Skip to first unread message

Ihor Menshykov

unread,
Jun 14, 2017, 12:03:28 PM6/14/17
to torch7
I'm trying to convert my model like this

require 'nn'
require 'cutorch'
require 'cunn'
require 'cudnn'
cutorch.setDevice(1)
model = torch.load( 'model-save-4S701-0.01-most-trained.t7' )
cudnn.convert(model, nn)
model_cpu = model :float()
sample_input = torch.FloatTensor(1,1,32,32)
model_cpu:forward( sample_input )

But I'm getting an error

/home/sharpy/torch/install/share/lua/5.1/nn/CMaxTable.lua:21: bad argument #1 to 'maskedFill' (torch.ByteTensor expected, got torch.FloatTensor)
stack traceback:
[C]: in function 'maskedFill'
/home/sharpy/torch/install/share/lua/5.1/nn/CMaxTable.lua:21: in function </home/sharpy/torch/install/share/lua/5.1/nn/CMaxTable.lua:12>
[C]: in function 'xpcall'
/home/sharpy/torch/install/share/lua/5.1/nn/Container.lua:63: in function 'rethrowErrors'
/home/sharpy/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function 'forward'
resaveTestModel.lua:33: in main chunk
...

I'm guessing this is essentially the same problem as here https://github.com/torch/torch7/issues/231 ?
Reply all
Reply to author
Forward
0 new messages