SuLvXiangXin / zipnerf-pytorch

Unofficial implementation of ZipNeRF
Apache License 2.0
783 stars 85 forks source link

error while training refnerf #66

Open jianglh-WHU opened 12 months ago

jianglh-WHU commented 12 months ago

hi~thanks for your excellent work!

When I use zipnerf-pytorch repo to train refnerf, I find an error:

internal/models line 499: raw_grad_density = torch.autograd.grad( outputs=raw_density, inputs=means, grad_outputs=d_output, create_graph=True, retain_graph=True, only_inputs=True)[0] RuntimeError: One of the differentiated Tensors appears to not have been used in the graph. Set allow_unused=True if this is the desired behavior.

Is it a dimension mismatch between raw_density and means? and how can I solve this error?

ckLibra commented 9 months ago

Hi, I meet the same problem. Have you solved it?

ckLibra commented 9 months ago

I find that it is because the @torch.no_grad in function track_linearize detach the graph. Comment @torch.no_grad helps. But it also increate the gpu consumption.