NVlabs / nvdiffrec

Official code for the CVPR 2022 (oral) paper "Extracting Triangular 3D Models, Materials, and Lighting From Images".
Other
2.13k stars 223 forks source link

Compile each time it runs? #82

Closed carlosedubarreto closed 1 year ago

carlosedubarreto commented 1 year ago

Hello and thansk for such amazing code.

I noticed that everytime that I run nvdiffrec it compiles some files. Is that really needed? Or can i disable it in some way?

I saw that some pyd gets in appdata (torch_extension folder) is created. If I point to that file I could skip the compiling everytime I run the script?

thanks a lot for you time

JHnvidia commented 1 year ago

Hi @carlosedubarreto,

The compilation is handled by pytorch/ninja and a compiled version should be in the torch_extension folder. It should only recompile if a file is changed. When we're using docker, the user folder is usually wiped on each docker instance, which causes recompiles, you may be experiencing something similar.

carlosedubarreto commented 1 year ago

Thanks a lot for the explanation

carlosedubarreto commented 1 year ago

I found that to make it work without trying to recompile (which gives me error when debugging) I can disable the torch.utils.cpp_extension.load and add a path to a place I have the files compiled. image

It worked fine with me.

I made those changes on C:\\dmodel\Lib\site-packages\nvdiffrast\torch\ops.py and D:\nvdiffrec\render\renderutils\ops.py

made a folder with these files image