I want to train a Seq2Seq model with M1 GPU. The source code runs well with cpu. However, if I change the device from cpu to mps:
device = torch.device("mps")
RuntimeError occurs when training model:
RuntimeError: Expected a proper Tensor but got None (or an undefined Tensor in C++) for argument #0 'grad_y'
8 Likes
Hi, have you got the sulotion?
aogara
3
I am having this problem too, and cannot find any information on how to solve it.
SamedAli
(Samed)
4
same error, just canβt find a way to fix it.
Tried
- loss on gpu and cpu
- retain_grad
- tried to push output and label to cpu before loss
mikesol
(Mike Solomon)
5
Same issue here as well, it looks like it is due to the LSTM in my network. I tried a GRU too but to no avail. CPU is fine, cuda is fine on Linux.