Error

[Pytorch] RuntimeError: Input and parameter tensors are not at the same device, found input tensor at cuda:0 and parameter tensor at cpu

HUR129 2022. 1. 27. 17:03

RuntimeError: Input and parameter tensors are not at the same device, found input tensor at cuda:0 and parameter tensor at cpu

 

결론은 input과 parameter tensor가 cpu / gpu에 나눠서 들어가있다는것이다. 

 

나의 실수는 모델을 수정하면서 data는 gpu에 올려놓고 수정한 모델은 gpu에 올려놓지 않아서 rnn cell 돌릴때 default로 cpu로 잡혀서 두개의 공간이 다르기때문에 연산이 불가했던 것...

 

다른 github issue로 data를 gpu에 올려놓지 못하는 error 상황이 나는것같은데 그런건 아니고 그냥 잘 확인하자. 모델이 어디에서 돌아가고있는지