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

Please init pose by register first #65

Closed shzcuber closed 4 weeks ago

shzcuber commented 1 month ago

Hello!

I installed FoundationPose with Ubuntu 20.04 and docker. I'm trying to run the run_demo.py script. Initially, I ran into the same memory issue as #26, so I changed my shorter side value to 10 (I can't do anything much above that value). Now, I'm getting this issue:

Screenshot from 2024-04-17 17-31-18

Any ideas on what the issue is?

Here's the error:

[__init__()] self.h5_file:
[__init__()] Using pretrained model from /home/yori/Documents/FoundationPose/learning/training/../../weights/2023-10-28-18-33-37/model_best.pth
[__init__()] init done
[reset_object()] self.diameter:0.19646325799497472, vox_size:0.009823162899748735
[reset_object()] self.pts:torch.Size([607, 3])
[reset_object()] reset done
[make_rotation_grid()] cam_in_obs:(42, 4, 4)
[make_rotation_grid()] rot_grid:(252, 4, 4)
num original candidates = 252
num of pose after clustering: 252
[make_rotation_grid()] after cluster, rot_grid:(252, 4, 4)
[make_rotation_grid()] self.rot_grid: torch.Size([252, 4, 4])
[<module>()] estimator initialization done
[<module>()] i:0
[register()] Welcome
Module Utils load on device 'cuda:0' took 3.69 ms
[register()] valid too small, return
[<module>()] i:1
[track_one()] Please init pose by register first
Traceback (most recent call last):
  File "run_demo.py", line 63, in <module>
    pose = est.track_one(rgb=color, depth=depth, K=reader.K, iteration=args.track_refine_iter)
  File "/home/yori/Documents/FoundationPose/estimater.py", line 253, in track_one
    raise RuntimeError
RuntimeError

Please let me know if there's any more information that could be provided.

shzcuber commented 1 month ago

torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 198.00 MiB (GPU 0; 3.81 GiB total capacity; 1.99 GiB already allocated; 196.25 MiB free; 2.25 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation.  See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

Here's my OutOfMemoryError if that helps.

GavinYang5 commented 1 month ago

It looks like the point cloud obtained from the mask you entered is too sparse and the registration is not successful.
Please check #44

shzcuber commented 1 month ago

Sorry, do you mind elaborating on what you mean by the mask I entered?

Not sure if this helps, but all the data I'm using is the demo_data as mentioned in the README.md - https://drive.google.com/drive/folders/1pRyFmxYXmAnpku7nGRioZaKrVJtIsroP?usp=sharing.

GavinYang5 commented 4 weeks ago

Because you change the shorter edge value to 10, this will cause your depth image to be scaled out too small, resulting in no depth data. Suggest trying FoundationPose on a GPU with larger memory.