facebookresearch / localrf

An algorithm for reconstructing the radiance field of a large-scale scene from a single casually captured video.
MIT License
956 stars 62 forks source link

RuntimeWarning: invalid value encountered in divide #33

Closed YJ-142150 closed 11 months ago

YJ-142150 commented 11 months ago

Great work!! When I Render 7 frame with size 960 x 540 at iteration 10000, I encountered this Runtimewarning.

Render 7 frame with size 960 x 540 0it [00:00, ?it/s]/home/xx/localrf/localTensoRF/renderer.py:105: RuntimeWarning: divide by zero encountered in divide bwd_flow_cmp0 /= np.quantile(bwd_flow_cmp0, 0.9) /home/xx/localrf/localTensoRF/renderer.py:105: RuntimeWarning: invalid value encountered in divide bwd_flow_cmp0 /= np.quantile(bwd_flow_cmp0, 0.9) /home/xx/localrf/localTensoRF/renderer.py:109: RuntimeWarning: divide by zero encountered in divide bwd_flow_cmp1 /= np.quantile(bwd_flow_cmp1, 0.9) /home/xx/localrf/localTensoRF/renderer.py:109: RuntimeWarning: invalid value encountered in divide bwd_flow_cmp1 /= np.quantile(bwd_flow_cmp1, 0.9) /home/xx/anaconda3/envs/localrf/lib/python3.8/site-packages/torch/utils/tensorboard/summary.py:444: RuntimeWarning: invalid value encountered in cast tensor = (tensor * scale_factor).clip(0, 255).astype(np.uint8)

How can I fix this?

ameuleman commented 11 months ago

Hi, This is for flow visualization and should not affect results. Perhaps it tries to compute the optical flow between two frames with the same poses. Are you getting sensible RGB and depth renders? What training parameters are you using?

YJ-142150 commented 11 months ago

I trained LocalRF on 'university2' dataset with command without FOV python localTensoRF/train.py --datadir scene_dir/university2 --logdir logs/university2. I didn't changed any of other parameters or codes in the model.

ameuleman commented 11 months ago

Alright. Does it give sensible results? If yes, I believe that you can ignore these warnings. BTW, university2's fov is 73.

YJ-142150 commented 11 months ago

Yeah, it gives sensible results. By the way, are other datasets' fov 73, too?

ameuleman commented 11 months ago

See train_all.sh for FOVs.

YJ-142150 commented 11 months ago

Thank you for answering the questions!!