RuntimeError Traceback (most recent call last)
----> 1 result = evaluate(model, train_loader) # Use the the evaluate function
/usr/local/lib/python3.6/dist-packages/torch/nn/functional.py in linear(input, weight, bias)
1688 if input.dim() == 2 and bias is not None:
1689 # fused op is marginally faster
-> 1690 ret = torch.addmm(bias, input, weight.t())
1692 output = input.matmul(weight.t())
RuntimeError: expected scalar type Float but found Double
I’m expecting your input has a wrong
dtype (probably double). Check if it has a correct type.
Can’t give a better answer with such info
While passing argument of features in forward method include .float(). For eg xb.float()
Hint: While converting the numpy array to tensor, change the type to float32
Help! I’m getting the same error as #Ravi Tiwari. I’m getting stuck in the “evaluate” portion.
I tried chaning the dtype to float, but it still doesn’t work.
I can’t figure out why… Can someone help?
Could you share the link to your notebook?
Thank you for replying back to me.
I checked others’ notebooks and found out the problem I had. float was the issue. Now, I have another issue… My answers are way off for some reason. it does not seem to be functional like it should. if you can help me, that would be great.