criterion = nn.MSELoss()
criterion(a, b)
This is dtype=torch.float for a and dtype=torch.int64 for b
So, both change to float
Similar Posts:
- [Solved] Pytoch nn.CrossEntropyLoss Error: RuntimeError: expected scalar type Long but found Float
- Keras.utils.to in keras_ Categorical method
- InvalidArgumentError (see above for traceback): You must feed a value for placeholder tensor ‘…
- [Solved] DCNv2 Compile Error: error: identifier “THCudaBlas_SgemmBatched” is undefined
- Tensorflowcenter {typeerror} non hashable type: “numpy. Ndarray”
- After installing torch on Linux, an error is still reported: importerror: no module named torch
- Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the same
- Error in loading pre training weight in torch. Load() in pytorch
- PyTorch UserWarning: volatile was removed and now has no effect. Use `with torch.no_grad():` inst
- Examples of torch.NN.Functional.Relu() and torch.NN.Relu()