HashNeRF-pytorch icon indicating copy to clipboard operation
HashNeRF-pytorch copied to clipboard

Undefined 'disps'

Open ZhaoyangZh opened this issue 2 years ago • 3 comments

https://github.com/yashbhalgat/HashNeRF-pytorch/blob/085ae25cb96c2913d74cbf00260dda8f93803f73/run_nerf.py#L200-L207

Variable disps is undefined here, do you mean depths? I tried to replace disps with depths and run python run_nerf.py --config configs/chair.txt --finest_res 512 --log2_hashmap_size 19 --lrate 0.01 --lrate_decay 10, but got exception at the entropy calculation: https://github.com/yashbhalgat/HashNeRF-pytorch/blob/085ae25cb96c2913d74cbf00260dda8f93803f73/run_nerf.py#L372-L375

Any ideas on this issue? Thanks in advance.

ZhaoyangZh avatar Jan 17 '23 21:01 ZhaoyangZh

The depths/disps bug is fixed in #30. The entropy error seems unrelated to that. Can you please elaborate on the error message you get? Maybe also look at the weights tensor when the exception is caught in the except loop.

yashbhalgat avatar Jan 27 '23 13:01 yashbhalgat

I met the same question when training, and the error message is: ValueError: Expected parameter probs of distribution Categorical to satisfy the constraint Simplex(), but found invalid values

update: seems like it happens when sampled points' weights along a ray all equal to zero. just use .entropy as a function rather than through Categorical.entropy

ShadowBbBb avatar Feb 01 '23 10:02 ShadowBbBb

I find weights. sum (-1, keepdim=True)>=1 caused the entropy() to fail.just normalize the weights could solve the problem.

Fjzd avatar Sep 12 '23 12:09 Fjzd