naver / kapture-localization

Provide mapping and localization pipelines based on kapture format
BSD 3-Clause "New" or "Revised" License
269 stars 42 forks source link

Error occur at kapture_localization/utils/symlink.py #13

Closed Keunmo closed 3 years ago

Keunmo commented 3 years ago

When I follow the tutorial and do mapping, an error occurs with symlimk.py

$ kapture_pipeline_mapping.py -v info \
> -i ./mapping/ \
> -kpt ./local_features/r2d2_500/keypoints/ \
> -desc ./local_features/r2d2_500/descriptors/ \
> -gfeat ./global_features/AP-GeM-LM18/global_features/ \
> -matches ./local_features/r2d2_500/NN_no_gv/matches/ \
> -matches-gv ./local_features/r2d2_500/NN_colmap_gv/matches/ \
> --colmap-map ./colmap-sfm/r2d2_500/AP-GeM-LM18_top5/ \
> --topk 5
Traceback (most recent call last):
  File "/home/jaram/anaconda3/envs/bluedot/bin/kapture_pipeline_mapping.py", line 4, in <module>
    __import__('pkg_resources').run_script('kapture-localization==0.1.2', 'kapture_pipeline_mapping.py')
  File "/home/jaram/anaconda3/envs/bluedot/lib/python3.8/site-packages/pkg_resources/__init__.py", line 651, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/home/jaram/anaconda3/envs/bluedot/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1448, in run_script
    exec(code, namespace, namespace)
  File "/home/jaram/anaconda3/envs/bluedot/lib/python3.8/site-packages/kapture_localization-0.1.2-py3.8.egg/EGG-INFO/scripts/kapture_pipeline_mapping.py", line 17, in <module>
    from kapture_localization.utils.symlink import can_use_symlinks, create_kapture_proxy
  File "/home/jaram/anaconda3/envs/bluedot/lib/python3.8/site-packages/kapture_localization-0.1.2-py3.8.egg/kapture_localization/utils/symlink.py", line 11, in <module>
    from kapture.io.features import guess_feature_name_from_path
ImportError: cannot import name 'guess_feature_name_from_path' from 'kapture.io.features' (/home/jaram/anaconda3/envs/bluedot/lib/python3.8/site-packages/kapture-1.1.1-py3.8.egg/kapture/io/features.py)

It seems there is no function name with 'guess_feature_name_from_path' in features.py. Problem was 'guess_feature_name_from_path', and I found related commit e54bad2.

I changed symlink.py to the old version(before e54bad2) and reinstall, and it works well. I didn't fully understand these codes, but I think it can be a temporary solution for this problem.

yocabon commented 3 years ago

Hi, You must have mismatched versions of kapture / kapture-localization (for example kapture-localization from code and kapture from pip). the commit you reference have a twin in kapture where the guess_feature_name_from_path was added: 84944a6

Keunmo commented 3 years ago

Hi, My kapture, kapture-localization version is kapture==1.1.1 (from pip) kapture-localization==0.1.2 (from source, edb501e) Should I need to install kapture from source too?

yocabon commented 3 years ago

Yes, it's better to use commits of kapture and kapture-localization that are close in time. Both repositories evolve together. I'll push a new release to pip next week, we haven't done this in a long time.

Keunmo commented 3 years ago

kapture==1.1.2 (from source) kapture-localization==0.1.2 (from source) works good! Thank you :)