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

No module named 'gridencoder' #98

Closed
shzcuber opened this issue May 2, 2024 · 4 comments
Closed

No module named 'gridencoder' #98

shzcuber opened this issue May 2, 2024 · 4 comments

Comments

@shzcuber
Copy link

shzcuber commented May 2, 2024

Hello,

I'm trying to run python bundlesdf/run_nerf.py --ref_view_dir /mnt/9a72c439-d0a7-45e8-8d20-d7a235d02763/DATASET/YCB_Video/bowen_addon/ref_views_16 --dataset ycbv

as shown in the README.md, but I'm getting this error:

(my) root@donghun:/home/donghun/Documents/FoundationPose# python3 bundlesdf/run_nerf.py --ref_view_dir /home/donghun/Documents/FoundationPose/ref_views_16 --dataset ycbv
Warp 1.0.0 initialized:
   CUDA Toolkit 11.5, Driver 12.2
   Devices:
     "cpu"      : "x86_64"
     "cuda:0"   : "NVIDIA GeForce RTX 3070" (8 GiB, sm_86, mempool enabled)
   Kernel cache:
     /root/.cache/warp/1.0.0
bundlesdf/run_nerf.py:61: DeprecationWarning: Starting with ImageIO v3 the behavior of this function will switch to that of iio.v3.imread. To keep the current behavior (and make this warning disappear) use `import imageio.v2 as imageio` or call `imageio.v2.imread` directly.
  rgb = imageio.imread(color_file)
[compute_scene_bounds()] compute_scene_bounds_worker start
[compute_scene_bounds()] compute_scene_bounds_worker done
[compute_scene_bounds()] merge pcd
[compute_scene_bounds()] compute_translation_scales done
translation_cvcam=[ 0.00114478  0.00392944 -0.00655522], sc_factor=11.946805208886905
[build_octree()] Octree voxel dilate_radius:1
[__init__()] level:0, vox_pts:torch.Size([1, 3]), corner_pts:torch.Size([8, 3])
[__init__()] level:1, vox_pts:torch.Size([8, 3]), corner_pts:torch.Size([27, 3])
[__init__()] level:2, vox_pts:torch.Size([64, 3]), corner_pts:torch.Size([125, 3])
[__init__()] level:3, vox_pts:torch.Size([480, 3]), corner_pts:torch.Size([693, 3])
[draw()] level:3
[draw()] level:3
Traceback (most recent call last):
  File "bundlesdf/run_nerf.py", line 113, in <module>
    run_ycbv()
  File "bundlesdf/run_nerf.py", line 85, in run_ycbv
    mesh = run_one_ob(base_dir=base_dir, cfg=cfg)
  File "bundlesdf/run_nerf.py", line 73, in run_one_ob
    mesh = run_neural_object_field(cfg, K, rgbs, depths, masks, cam_in_obs, save_dir=save_dir, debug=0)
  File "bundlesdf/run_nerf.py", line 39, in run_neural_object_field
    nerf = NerfRunner(cfg, rgbs_, depths_, masks_, normal_maps=None, poses=poses, K=K, occ_masks=None, build_octree_pcd=pcd_normalized)
  File "/home/donghun/Documents/FoundationPose/bundlesdf/nerf_runner.py", line 158, in __init__
    self.create_nerf()
  File "/home/donghun/Documents/FoundationPose/bundlesdf/nerf_runner.py", line 209, in create_nerf
    embed_fn, input_ch = get_embedder(self.cfg['multires'], self.cfg, i=self.cfg['i_embed'], octree_m=self.octree_m)
  File "/home/donghun/Documents/FoundationPose/bundlesdf/nerf_helpers.py", line 204, in get_embedder
    from mycuda.torch_ngp_grid_encoder.grid import GridEncoder
  File "/home/donghun/Documents/FoundationPose/bundlesdf/mycuda/torch_ngp_grid_encoder/grid.py", line 14, in <module>
    import gridencoder
ModuleNotFoundError: No module named 'gridencoder'```

Any idea at what the issue is? I'm using the docker container.

Thanks.
@shzcuber shzcuber closed this as completed May 2, 2024
@GZF123
Copy link

GZF123 commented May 6, 2024

Hello,
I also encountered this problem,have you solved it?

@Hotsburp
Copy link

Hotsburp commented May 8, 2024

Hi, I also encountered the same issue but i was running on 4090 instead of 3090, so i am not too sure if there is a fix for 4090 given that the README required some DockerFile and setup.py changes to the torch versions.

Saw this solution elsewhere which may help that focused on the torch versions and stuff which i guess is the case?

Do update if you guys managed to solve it!

@Hotsburp
Copy link

Hotsburp commented May 8, 2024

I think i solved the issue. My guess is that when you first build your container, you did not run the bash build_all.sh script after bash run_container.sh. After doing that, everything should work as intended.

@qihaoqian
Copy link

just run the command below to install gridencoder
cd ${PROJ_ROOT}/bundlesdf/mycuda &&
rm -rf build egg *.so &&
python -m pip install -e .

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