NVlabs / FoundationPose

[CVPR 2024 Highlight] FoundationPose: Unified 6D Pose Estimation and Tracking of Novel Objects
https://nvlabs.github.io/FoundationPose/
Other
955 stars 99 forks source link

No module named 'gridencoder' #98

Closed shzcuber closed 2 weeks ago

shzcuber commented 2 weeks ago

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.
GZF123 commented 1 week ago

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

Hotsburp commented 1 week ago

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 commented 1 week ago

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.