Skip to content

Fix the same device issue#22

Open
Anshita1Saxena wants to merge 1 commit intoandregraubner:mainfrom
Anshita1Saxena:main
Open

Fix the same device issue#22
Anshita1Saxena wants to merge 1 commit intoandregraubner:mainfrom
Anshita1Saxena:main

Conversation

@Anshita1Saxena
Copy link

Hi Authors,

I fixed this issue RuntimeError: indices should be either on cpu or on the same device as the indexed tensor (cpu) in file utils/losses.py.
Please review it and merge it.

Stacktrace:

Epoch 1:
^M  0%|          | 0/396 [00:00<?, ?it/s]^M  0%|          | 0/396 [00:29<?, ?it/s]
Traceback (most recent call last):
  File "/project/60025/anshita/ClimateNet/example.py", line 20, in <module>
    cgnet.train(train)
  File "/project/60025/anshita/ClimateNet/climatenet/models.py", line 90, in train
    loss = jaccard_loss(outputs, labels)
  File "/project/60025/anshita/ClimateNet/climatenet/utils/losses.py", line 21, in jaccard_loss
    true_1_hot = torch.eye(num_classes)[true.squeeze(1)]
RuntimeError: indices should be either on cpu or on the same device as the indexed tensor (cpu)

Thank You.

Best regards,
Anshita Saxena

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant