Replies: 1 comment 7 replies
-
Hi @gleefeng, This sounds very related to this PR. I suggest you pull and compile this branch and run your script, hopefully, it should just work. This will soon be merged on |
Beta Was this translation helpful? Give feedback.
7 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 want to realize the differetiable camera in mitsuba3
for example,I want to optimize 'ThinLensCamera.aperture_radius' this key
so I just to change the code
void traverse(TraversalCallback *callback) override { Base::traverse(callback); callback->put_parameter("aperture_radius", m_aperture_radius, +ParamFlags::Differentiable);
ParamFlags::NonDifferentiable ->ParamFlags::Differentiable
after this , run the optimizer in python test environment.
opt = mi.ad.Adam(lr=0.05)
opt[key] = params[key]
params.update(opt)
but get the error :
Exception: The contribution computed by the differential rendering phase is not attached to the AD graph! Raising an exception since this is usually indicative of a bug (for example, you may have forgotten to call dr.enable_grad(..) on one of the scene parameters, or you may be trying to optimize a parameter that does not generate derivatives in detached PRB.)
drjit-autodiff: variable leak detected (7 variables remain in use)!
of course ,I don't think it's that simple, but I want to know what else needs to be modified? Is there any documentation we can refer to?
Beta Was this translation helpful? Give feedback.
All reactions