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

issue at raymarching #74

Closed
yyashpatel opened this issue Oct 17, 2022 · 7 comments
Closed

issue at raymarching #74

yyashpatel opened this issue Oct 17, 2022 · 7 comments

Comments

@yyashpatel
Copy link

yyashpatel commented Oct 17, 2022

Hi !
I face this error when at the command ray_marching()
Please help me this ... thank you !

File "train.py", line 95, in
main()
File "train.py", line 93, in main
nerf_sim.training()
File "train.py", line 63, in training
self.nerf.render(ray_o, ray_d, rgb_gt, step)
File "/home/yash/Documents/nerf/NeRF/run_NeRF.py", line 64, in render
rgb, acc, depth = self.output.renderer(ray_o,
File "/home/yash/Documents/nerf/NeRF/rendering.py", line 59, in renderer
packed_info, t_start, t_end = self.vol_sampling(ray_o, ray_d, aabb, grid, render_step_size, cone_angle, alpha_thre)
File "/home/yash/Documents/nerf/NeRF/rendering.py", line 46, in vol_sampling
packed_info, t_start, t_end = ray_marching(ray_o,
File "/home/yash/anaconda3/envs/nerf_sim/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "/home/yash/anaconda3/envs/nerf_sim/lib/python3.8/site-packages/nerfacc/ray_marching.py", line 156, in ray_marching
grid_roi_aabb = grid.roi_aabb
AttributeError: 'float' object has no attribute 'roi_aabb'

@yyashpatel
Copy link
Author

yyashpatel commented Oct 17, 2022

the above issue is resolved, It's working now,

Just one more thing -

the aabb argument that has to be specified in OccupancyGrid(roi_aabb = aabb) is the same as that in ray_marching(scene_aabb=aabb) ?

@liruilong940607
Copy link
Collaborator

liruilong940607 commented Oct 17, 2022

They can be the same but not necessary to be.

If you have a scene bounded by a bbox, it is recommended to set them to the same.

If you want to use the contraction for the occupancy grid to cover an infinity space, e.g., OccupancyGrid(..., contraction_type=ContractionType.UN_BOUNDED_SPHERE), then the roi_aabb is the region of interest in the infinity space. In this case you shouldn't set the scene_aabb to ray_marching, as it will only march inside this bounding box

@yyashpatel
Copy link
Author

Understood thank you !

I just wanted to know , when performing testing , I wonder how the python api commands provided are to be used .

Because in the training part I use occupancy grid in the raymarching() function . And since it gets updated every time, so I am a bit confused about how to test the model once I have save the weights ?

@liruilong940607
Copy link
Collaborator

Same way as you do the training — use the occupancy grid as well.

That means you would want to save both your network and the occupancy grid, and reload them when testing

@yyashpatel
Copy link
Author

Oh okay , I did get your point.
Saving occupancy grid using torch.save() .?

@liruilong940607
Copy link
Collaborator

yeah the occupancy grid is a torch.nn.Module so you can save it in the same way you do with network.

@liruilong940607
Copy link
Collaborator

Closed as the problems seem to be all resolved. Feel free to reopen it if not.

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

2 participants