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

RuntimeError: trying to differentiate twice a function that was markedwith @once_differentiable #50

Closed
theFilipko opened this issue Feb 27, 2022 · 1 comment

Comments

@theFilipko
Copy link

I am trying to use only the Encoding models for my SDF model, where the SDF network is written in pytorch. I need to calculate the gradients from the SDF network which goes as input to the Color network. However, when calling loss.backward() it says RuntimeError: trying to differentiate twice a function that was markedwith @once_differentiable. Any ideas how to solve it?

@Tom94
Copy link
Collaborator

Tom94 commented Feb 28, 2022

tiny-cuda-nn doesn't support second order derivatives, which means that the surface normal of the SDF network (which is the first derivative) is not allowed to appear anywhere in the loss. Or, alternatively, if it does appear, it must be computed in terms of finite differences such that everything boils down to just first-order derivatives.

@Tom94 Tom94 closed this as completed Feb 28, 2022
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

2 participants