Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined 'disps' #29

Open
ZhaoyangZh opened this issue Jan 17, 2023 · 3 comments
Open

Undefined 'disps' #29

ZhaoyangZh opened this issue Jan 17, 2023 · 3 comments

Comments

@ZhaoyangZh
Copy link

disps = np.stack(disps, 0)
if gt_imgs is not None and render_factor==0:
avg_psnr = sum(psnrs)/len(psnrs)
print("Avg PSNR over Test set: ", avg_psnr)
with open(os.path.join(savedir, "test_psnrs_avg{:0.2f}.pkl".format(avg_psnr)), "wb") as fp:
pickle.dump(psnrs, fp)
return rgbs, disps

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:

try:
entropy = Categorical(probs = torch.cat([weights, 1.0-weights.sum(-1, keepdim=True)+1e-6], dim=-1)).entropy()
except:
pdb.set_trace()

Any ideas on this issue? Thanks in advance.

@ZhaoyangZh ZhaoyangZh changed the title Undefined 'disp' Undefined 'disps' Jan 17, 2023
@yashbhalgat
Copy link
Owner

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.

@ShadowBbBb
Copy link

ShadowBbBb commented Feb 1, 2023

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

@Fjzd
Copy link

Fjzd commented Sep 12, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants