Skip to content

Both tensors are on same device but raises an error both aren't #607

Discussion options

You must be logged in to vote

Copy of #608 (comment)

The solution is to move your metrics to the correct device (similar to you moving model and data). So instead of

metric = torchmetrics.Accuracy()

do

metric = torchmetrics.Accuracy().to(device)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ThiruRJST
Comment options

Answer selected by SkafteNicki
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants