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

TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first. #10

Open
mikbuch opened this issue Feb 1, 2024 · 3 comments

Comments

@mikbuch
Copy link

mikbuch commented Feb 1, 2024

Current versions of modules (January 2024).

@mikbuch
Copy link
Author

mikbuch commented Feb 1, 2024

In utils add:

    heatmap = cv2.applyColorMap(np.uint8(255 * mask.cpu().squeeze()), cv2.COLORMAP_JET)

Line 15

@mikbuch
Copy link
Author

mikbuch commented Feb 1, 2024

Then it will work

@mikbuch
Copy link
Author

mikbuch commented Feb 1, 2024

I re-created the repository, indent to modify it further: https://github.com/mikbuch/gradcam-pytorch-pet. Thank you Konny for creating this very useful example.

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