hughperkins / pytorch

Python wrappers for torch and lua

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pop type torch.CudaTensor not implemented

rracinskij opened this issue · comments

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

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.

(so eg something like return output:float() )

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!

Cool :-)