cudnn.torch icon indicating copy to clipboard operation
cudnn.torch copied to clipboard

nn.VolumetricMaxUnpooling and cudnn.VolumetricMaxPooling don't play with each other

Open vfonov opened this issue 8 years ago • 0 comments

If a model contains nn.VolumetricMaxPooling module (probably same goes for SpatialMaxPooling), and nn.VolumetricMaxUnpooling and then converted to cudnn using cudnn.convert, then at execution time following message shows up:

/home/vfonov/src/torch/install/share/lua/5.1/nn/THNN.lua:110: bad argument #4 to 'v' (cannot convert 'struct THCudaTensor *' to 'struct THCudaLongTensor *')
stack traceback:
	[C]: in function 'v'
	/home/vfonov/src/torch/install/share/lua/5.1/nn/THNN.lua:110: in function 'VolumetricMaxUnpooling_updateOutput'
	...orch/install/share/lua/5.1/nn/VolumetricMaxUnpooling.lua:31: in function <...orch/install/share/lua/5.1/nn/VolumetricMaxUnpooling.lua:23>
	[C]: in function 'xpcall'
	.../vfonov/src/torch/install/share/lua/5.1/nn/Container.lua:63: in function 'rethrowErrors'
	...vfonov/src/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function 'forward'
	cnn_semisup.lua:271: in function 'opfunc'
	/home/vfonov/src/torch/install/share/lua/5.1/optim/adam.lua:37: in function 'adam'
	cnn_semisup.lua:283: in main chunk
	[C]: in function 'dofile'
	.../src/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
	[C]: at 0x00405d50

This is due to the fact that cudnn.VolumetricMaxPooling module does not use indices and itime,iheight,iwidth that VolumetricMaxUnpooling tries to grab. Workaround is to disable conversion to cudnn for VolumetricMaxPooling

vfonov avatar Dec 14 '16 01:12 vfonov