TensoRF icon indicating copy to clipboard operation
TensoRF copied to clipboard

Renderer issue

Open felizang opened this issue 2 years ago • 1 comments

Thank you for your great work!

BTW, when I run TensoRF on llff fern data, I got an error and solved it. I want to report this.

The error was like this:

Traceback (most recent call last): File "train.py", line 301, in reconstruction(args) File "train.py", line 225, in reconstruction prtx=f'{iteration:06d}_', N_samples=nSamples, white_bg = white_bg, ndc_ray=ndc_ray, compute_extra_metrics=False) File "/home/asc/PycharmProjects/nerf-pytorch/venv/lib/python3.6/site-packages/torch/autograd/grad_mode.py", line 28, in decorate_context return func(*args, **kwargs) File "/home/asc/PycharmProjects/TensoRF/renderer.py", line 38, in evaluation idxs = list(range(0, test_dataset.all_rays.shape[0], img_eval_interval)) ValueError: range() arg 3 must not be zero

So, I modified renderer.py like this

img_eval_interval = 1 if N_vis < 0 else test_dataset.all_rays.shape[0] // N_vis
if img_eval_interval == 0:
    img_eval_interval = 1                   # add these 2 lines

And it worked.

felizang avatar Mar 28 '22 13:03 felizang

Thank! I will update it next push. BTW, you can also set 'N_vis' to -1 for resolving this error.

apchenstu avatar Mar 30 '22 01:03 apchenstu