Closed tastyminerals closed 7 years ago
I figured out the issue. If anyone encounters such error, it means that somewhere during training or validation you explicitly convert your data to :double()
or anything that is not CUDA tensor. I found the line in my code where I do batch:double():squeeze(4)
, this line reconverts all CUDA tensors back to DoubleTensors
and causes this issue.
Closing.
Though, I wonder why doesn't nn.SplitTable(1)
convert IntTensor
to CudaTensor
when it passes the data through.
I have two models A and B, where B model is the extension of A, having almost the same architecture except for additional
nn.Linear
,nn.CAddTable
layers beforenn.LogSoftMax
, see models below:I can successfully run model A using
--cuda
parameter. However, when I attempt to run model B (the one above), it crashes with the following error:Both models handle
--cuda
parameter as:So, why does B model crash when A works fine?