Closed arppy closed 2 years ago
thanks for raising it. indeed, we never seriously tried multi-GPU evaluation ourselves. we'll look into it!
Hi @arppy, thanks also for suggesting a solution to this issue. I will work on it ASAP. Meanwhile, I think that a temporary hack to have it work could be to set the CUDA_VISIBLE_DEVICES
environment variable to the index of the GPU you want to use
@arppy it should have been solved by #61. Feel free to re-open this issue if the fix doesn't work or if you meant something else to be fixed 😊
@dedeswim, you are amazing! Thanks.
self.mean_cuda = self.mean.cuda()
robustbench/model_zoo/architectures/dm_wide_resnet.py#L279self.std_cuda = self.std.cuda()
robustbench/model_zoo/architectures/dm_wide_resnet.py#L280 This referenced code lines force to put the two tensor on cuda:0. So in case of multiple GPU, I have got an error like this: RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:3 and cuda:0!.cuda()
to.to(device)
device
should be a global parameter that a user can specify