Resnet18 throws exception on conversion to half floats

The problem is because you’re doing it on CPU. Here’s a reply on a similar problem from another post on pytorch forums. It should work if you dua a .cuda() and move everything to GPU.

link - Variable failed to wrap HalfTensor - #2 by albanD