htqin / IR-Net

[CVPR 2020] This project is the PyTorch implementation of our accepted CVPR 2020 paper : forward and backward information retention for accurate binary neural networks.
177 stars 38 forks source link

a bug using multiple GPUS #4

Closed Haleski47 closed 4 years ago

Haleski47 commented 4 years ago

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~

Haleski47 commented 4 years ago

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 4 years ago

Okay, thanks for your efforts.