Graph Dependencies between Rendered Images #1241
Unanswered
Constantin1709
asked this question in
Q&A
Replies: 1 comment 3 replies
-
The structure of the code shown doesn't quite reflect what you say (it looks like the second loop happens after the first loop). Are there any parameters or other things requiring grad involved in the rendering? I think seeing more of your code may make it easier to help. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am rendering several images one by one with the Mesh Renderer (with HardPhongShader and MeshRasterizer) that I am concatenating and then passing to a Classifier in batches.
I have no problem with the 1st batch but when performing backward.loss() after the 2nd batch has been passed through the Classifier I am getting a dependency error.
_RuntimeError: Trying to backward through the graph a second time, but the saved intermediate results have already been freed. Specify retain_graph=True when calling backward the first time._
Every time I am rendering a new image I am defining again all the elements that make up the Renderer (cameras, lights, blend_params, raster_settings, MeshRenderer), mainly because I am changing some of the parameters in between generating the individual images.
`
Is there a way to get rid of the dependency between the rendered images that is stored in the computational graph of the image tensors?
Any help or input would be highly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions