RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:1 and cuda:0!

Vladyslav
Thu, 18 Apr 2024 11:43:35 +0000

try to specify the cuda device:
device = ‘cuda:0’