Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recall CE runtime error #2

Open
YFrisch opened this issue Jul 27, 2023 · 0 comments
Open

Recall CE runtime error #2

YFrisch opened this issue Jul 27, 2023 · 0 comments

Comments

@YFrisch
Copy link

YFrisch commented Jul 27, 2023

Hi. This simple test with the Recall CE

gt = torch.randint(low=0, high=10, size=(8, 32, 32)).cuda()
pred = torch.rand(size=(8, 10, 32, 32)).cuda()
recal_ce = RecallCrossEntropy(n_classes=10)
L = recal_ce(pred, gt)

throws a runtime error

>       gt_count[gt_idx == self.ignore_index] = gt_count[1]
E       RuntimeError: unsupported operation: some elements of the input tensor and the written-to tensor refer to a single memory location. Please clone() the tensor before performing the operation.

Using Python 3.10

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

No branches or pull requests

1 participant