facebookresearch / theseus

A library for differentiable nonlinear optimization
MIT License
1.74k stars 124 forks source link

AutoDiffCostFunction with CUDA C++ #635

Closed sssphil closed 9 months ago

sssphil commented 9 months ago

❓ Questions and Help

Hi,

I'm trying to project a mesh onto a depth map and minimize the difference, and the library that I use to rasterize the vertices uses C++ cuda for the purpose. In the cost function, I use that library to find out which mesh faces are visible. But when running the code, I get this runtime error Unrecognized tensor type ID: FuncTorchGradWrapper when the cuda code is called. I tried adding torch.no_grad() but the error is still there. Any ideas on how I can use cuda with the cost function?

Thanks a lot, Phil