expected scalar type float but found half
This problem is obviously that the parameter types in the network do not agree;
modification:
add in front: I failed to test this
torch.set_default_tensor_type(torch.DoubleTensor)
torch.set_default_tensor_type(torch.FloatTensor)
- 1
Alternatively, add before running the network:
net = net.double()
My workaround:
An error was reported during aimet training,
Directly find the place where the error is reported, add data.float()