NVIDIAGameWorks / kaolin

A PyTorch Library for Accelerating 3D Deep Learning Research
Apache License 2.0
4.44k stars 548 forks source link

variables needed for gradient computation has been modified #832

Open Dannynis opened 4 days ago

Dannynis commented 4 days ago

Hey, im trying to use this great framework to do texture optimization but im facing the next isssue, all the steps to reproduce are in this colab notebook.

https://colab.research.google.com/drive/1K6oT4DD7NroacY3jd6k-62QI7PzLGnXM?usp=sharing

key code:

mesh.materials[0].diffuse_texture = torch.nn.Parameter(mesh.materials[0].diffuse_texture) r = kal.render.easy_render.render_mesh(camera, mesh.cuda()) (r['render'].sum()).backward()

and the error:

File "/usr/local/lib/python3.10/dist-packages/kaolin/render/lighting/sg.py", line 340, in sg_warp_specular_term h /= torch.sqrt(_dot(h, h)) (Triggered internally at ../torch/csrc/autograd/python_anomaly_mode.cpp:111.) return Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass

Thank you!

OfirShechter commented 4 days ago

Having pretty much the same issue... Any solution so far?

Caenorst commented 3 days ago

Hi @Dannynis , @OfirShechter ,

I'm going to push a fix soon, will be in next release

Caenorst commented 3 days ago

I just merged the fix, will be appearing in our next release (should be this week! :) )

Dannynis commented 3 days ago

works great, thank you