pop type torch.CudaTensor not implemented
rracinskij opened this issue · comments
Ricard Racinskij commented
Hi,
I get a strange error while trying a forward pass through a loaded Torch model:
function TorchModel:forward(input)
local output = self.net:forward(torch.rand(1,3,112,112):cuda())
return output
end
PyTorchAug.py", line 181, in popSomething
raise Exception('pop type ' + str(typestring) + ' not implemented')
Exception: pop type torch.CudaTensor not implemented
Hugh Perkins commented
It means you're returning a cudatensor from the lua side, into the python side.
Your easiest option would be to convert it to a FloatTensor on the lua side, before passing it into the python.
Hugh Perkins commented
(so eg something like return output:float()
)
Ricard Racinskij commented
Yes, it works. The error was referenced to
local output = self.net:forward(torch.rand(1,3,112,112):cuda())
and not to the return output
, so it was a bit confusing.
Many thanks!
Hugh Perkins commented
Cool :-)