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

Plotting routines fail for segments that contain tensors with require_grad=True #287

Closed
Hespe opened this issue Oct 28, 2024 · 0 comments · Fixed by #288
Closed

Plotting routines fail for segments that contain tensors with require_grad=True #287

Hespe opened this issue Oct 28, 2024 · 0 comments · Fixed by #288
Assignees
Labels
bug Something isn't working

Comments

@Hespe
Copy link
Member

Hespe commented Oct 28, 2024

The plotting routines of Cheetah currently fail if the Segment they are called on contain tensors with require_grad=True. This is because Matplotlib internally calls tensor.numpy(), which fails for tensors that include gradients.

RuntimeError: Can't call numpy() on Tensor that requires grad. Use tensor.detach().numpy() instead.

@Hespe Hespe added the bug Something isn't working label Oct 28, 2024
@Hespe Hespe self-assigned this Oct 28, 2024
@Hespe Hespe mentioned this issue Nov 13, 2024
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant