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

illegal memory access #13

Open
tkkcc opened this issue Jan 17, 2024 · 0 comments
Open

illegal memory access #13

tkkcc opened this issue Jan 17, 2024 · 0 comments

Comments

@tkkcc
Copy link

tkkcc commented Jan 17, 2024

I got this error when using this library to optimize flow, with lpips loss

RuntimeError: CUDA error: an illegal memory access was encountered

This problem maybe related to my loss, my torch version and cuda version, but I finally solved it by changing

auto flow_grad = at::empty_like(flow);

to

  auto flow_grad = at::zeros_like(flow);

As in the backward_kernel function, only "not outside" position's flow_grad will be update, while "outside" position will remain the value inited by "empty_like". These parts are random values I think.

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