htqin/IR-Net

a bug using multiple GPUS

Closed this issue · 2 comments

hello ~ when i run your code with the multiple GPUS, i find the problem.
RuntimeError: binary_op(): expected both inputs to be on same device, but input a is on cuda:3 and input b is on cuda:0
when using the single GPU. it's safe. i check the tensor and find the k and t is stored in GPU0 and cause the problem.
i dont know if you have any idea how to solve it
Thanks~

for the parameter k and t
after i add
t = Parameter(t)
k = Parameter(k)
it get solved.

i refer this blog. https://blog.csdn.net/weixin_42105432/article/details/101145056
Thanks for your code ~

htqin commented

Okay, thanks for your efforts.