michalpolic / hololens_mapper

The mapping pipeline for HoloLens device
15 stars 3 forks source link

'Unable to open object' error in HLOC map composer #8

Closed rakshith95 closed 2 years ago

rakshith95 commented 2 years ago

Hello @michalpolic , I did not notice this when running the pipeline, but I get the following error in the HlocMapCreator node:

[08/16/2022 17:16:36 INFO] Matching local features with configuration:
{'model': {'name': 'superglue',
           'sinkhorn_iterations': 50,
           'weights': 'outdoor'},
 'output': 'matches-superglue'}
Loaded SuperGlue model ("outdoor" weights)
  0%|                                                                                                                 | 0/42280 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "/app/build_dataset.py", line 46, in <module>
    sfm_matches = match_features.main(
  File "/app/hloc/match_features.py", line 83, in main
    match_from_paths(
  File "/home/rakshith/.local/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 28, in decorate_context
    return func(*args, **kwargs)
  File "/app/hloc/match_features.py", line 138, in match_from_paths
    grp = fd[name0]
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "/home/rakshith/.local/lib/python3.8/site-packages/h5py/_hl/group.py", line 288, in __getitem__
    oid = h5o.open(self.id, self._e(name), lapl=self._lapl)
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "h5py/h5o.pyx", line 190, in h5py.h5o.open
KeyError: 'Unable to open object (component not found)'
[2022-08-16 17:18:29,331][info] HLOC map composer done.

I'm not able to figure out the source of this error. Have you seen this before, or do you know why it could be happening?

rakshith95 commented 2 years ago

Ok I think I figured out what was going wrong. It was throwing the error in this line grp = fd[name0], and name0 was of the form <image_folder/file.jpg> whereas in the HlocMapCreator cache folder the images were just copied without the outer <image_folder> and hence were of the form <file.jpg>, and that is why it was unable to open the object since fd[name0] did not exist. It works after I added the following lines

        name0 = name0.split('/')[-1]
        name1 = name1.split('/')[-1]    

after line 150 and it seems to work.

michalpolic commented 2 years ago

Sorry for late answer. The problem with image paths can be usually solved in the scope of the IOConvertor. The image paths at the output of this node can be "original", adjusted for running in container (/data/), or without the folder (just ). The error you received say that there are no features in h5py file, i.e., the detector was not able to load images or failed to detect keypoints.