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

loretoparisi
Tue, 24 Sep 2024 19:16:36 +0000

ehalit:

for i in model.named_parameters():
    print(f"{i[0]} -> {i[1].device}")

This is indeed very good

for i in model.named_parameters():
    print(f"{i[0]} -> {i[1].device}")

Thanks to this I was able to find where my embeddigs were!

TripletEmbedding(
  (embedding): Embedding(2576744, 512)
)
embedding.weight -> cuda:0