Replies: 1 comment 2 replies
-
I think the error message is pretty explicit: this is not something that is supported. I'm not sure I understand your analogy to On the other hand To be clear, the error message here is about your loop in |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I made a little sample function, similar to the one you would find in an integrator, that shoots rays from a defined set of points, and traces them through the scene. Calling
sample(ray_origins, ray_dir, paths)
works, and it even works if I call it multiple times inside a for loop without an issue.The problem arises when I try to apply a displacement texture map similar to the caustics optimization tutorial. It is basically the exact same function as the tutorial. I am trying to optimize the vertex of some mesh such that all the points at a particular depth value come closer to a point reference value. When I run:
I get the following error :
Exception: loop_process_state(): one of the supplied loop state variables of type Float is attached to the AD graph (i.e., grad_enabled(..) is true). However, propagating derivatives through multiple iterations of a recorded loop is not supported (and never will be). Please see the documentation on differentiating loops for details and suggested alternatives.
The error disappears when I remove
dr.enable_grad(paramsOpt['data'])
inHow do I go about keeping the gradients inside a custom mi.loop to optimize a the vertices of a mesh? Seems like mi.render does that for us.
Beta Was this translation helpful? Give feedback.
All reactions