cvg / limap

A toolbox for mapping and localization with line features.
BSD 3-Clause "New" or "Revised" License
691 stars 68 forks source link

Questions about QuickStart #59

Closed dansonZhang closed 10 months ago

dansonZhang commented 10 months ago

Hello, thank you very much for providing open source code. I encountered the following error while sequentially executing QuickStart related instructions. Hope to provide assistance.

I followed the doc and continued to execute until an error occurred during this command: python runners/hypersim/fitnmerge.py --output_dir outputs/quickstart_fitnmerge

The terminal reported the following error.I guess it's because the relevant models were not downloaded (for example, I don't have the directory weight dir mentioned here:/home/danson/. limap/models), please help me.

[LOG] Number of images: 98 [LOG] Output dir: outputs/quickstart_fitnmerge [LOG] Loading dir: outputs/quickstart_fitnmerge [LOG] weight dir: /home/danson/.limap/models [SuperPoint] Extracting local features with configuration: {'model': {'max_keypoints': 4096, 'name': 'superpoint', 'nms_radius': 3}, 'output': 'feats-superpoint-n4096-r1024', 'preprocessing': {'grayscale': True, 'resize_max': 1024}} [2023/11/29 13:14:09 hloc INFO] Found 98 images in root outputs/quickstart_fitnmerge/colmap_outputs/images. Traceback (most recent call last): File "/home/danson/Code_center/limap/runners/hypersim/fitnmerge.py", line 41, in main() File "/home/danson/Code_center/limap/runners/hypersim/fitnmerge.py", line 38, in main run_scene_hypersim(cfg, dataset, cfg["scene_id"], cam_id=cfg["cam_id"]) File "/home/danson/Code_center/limap/runners/hypersim/fitnmerge.py", line 14, in run_scene_hypersim linetracks = limap.runners.line_fitnmerge(cfg, imagecols, depths) File "/home/danson/Code_center/limap/limap/runners/line_fitnmerge.py", line 106, in linefitnmerge , neighbors, ranges = _runners.compute_sfminfos(cfg, imagecols) File "/home/danson/Code_center/limap/limap/runners/functions.py", line 126, in compute_sfminfos _psfm.run_colmap_sfm_with_known_poses(cfg["sfm"], imagecols, output_path=colmap_output_path, skip_exists=cfg["skip_exists"]) File "/home/danson/Code_center/limap/limap/pointsfm/colmap_sfm.py", line 182, in run_colmap_sfm_with_known_poses run_hloc_matches(cfg["hloc"], image_path, Path(db_path), keypoints=keypoints_in_order, neighbors=neighbors, imagecols=imagecols_tmp) File "/home/danson/Code_center/limap/limap/pointsfm/colmap_sfm.py", line 76, in run_hloc_matches feature_path = run_superpoint(feature_conf, image_path, outputs, keypoints=keypoints) File "/home/danson/Code_center/limap/venv/lib/python3.9/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context return func(*args, kwargs) File "/home/danson/Code_center/limap/limap/point2d/superpoint/main.py", line 55, in run_superpoint model = SuperPoint(conf['model']).eval().to(device) File "/home/danson/Code_center/limap/limap/point2d/superpoint/superpoint.py", line 144, in init self.load_state_dict(torch.load(str(path))) File "/home/danson/Code_center/limap/venv/lib/python3.9/site-packages/torch/serialization.py", line 713, in load return _legacy_load(opened_file, map_location, pickle_module, pickle_load_args) File "/home/danson/Code_center/limap/venv/lib/python3.9/site-packages/torch/serialization.py", line 920, in _legacy_load magic_number = pickle_module.load(f, **pickle_load_args) EOFError: Ran out of input

Eastwind-17 commented 10 months ago

I had met the same situation. Print the path in 'self.load_state_dict(torch.load(str(path)))' and then delete the file in the path. Rerun the program, it will auto download.

dansonZhang commented 10 months ago

I had met the same situation. Print the path in 'self.load_state_dict(torch.load(str(path)))' and then delete the file in the path. Rerun the program, it will auto download.

Thank you very much for your help. I have successfully solved this problem.

But with the same command, I encountered a new problem: Computing visual neighbors... (n_neighbors = 100) [LOG] Start 2D line detection and description (detector = deeplsd, n_images = 98)... Traceback (most recent call last): File "/home/danson/Code_center/limap/runners/hypersim/fitnmerge.py", line 41, in main() File "/home/danson/Code_center/limap/runners/hypersim/fitnmerge.py", line 38, in main run_scene_hypersim(cfg, dataset, cfg["scene_id"], cam_id=cfg["cam_id"]) File "/home/danson/Code_center/limap/runners/hypersim/fitnmerge.py", line 14, in run_scene_hypersim linetracks = limap.runners.line_fitnmerge(cfg, imagecols, depths) File "/home/danson/Code_center/limap/limap/runners/line_fitnmerge.py", line 115, in line_fitnmerge all_2dsegs, = _runners.compute_2d_segs(cfg, imagecols, compute_descinfo=cfg["line2d"]["compute_descinfo"]) File "/home/danson/Code_center/limap/limap/runners/functions.py", line 168, in compute_2d_segs detector = limap.line2d.get_detector(cfg["line2d"]["detector"], max_num_2d_segs=cfg["line2d"]["max_num_2d_segs"], do_merge_lines=cfg["line2d"]["do_merge_lines"], visualize=cfg["line2d"]["visualize"], weight_path=weight_path) File "/home/danson/Code_center/limap/limap/line2d/register_detector.py", line 30, in get_detector from .DeepLSD import DeepLSDDetector File "/home/danson/Code_center/limap/limap/line2d/DeepLSD/init.py", line 1, in from .deeplsd import DeepLSDDetector File "/home/danson/Code_center/limap/limap/line2d/DeepLSD/deeplsd.py", line 4, in from deeplsd.models.deeplsd_inference import DeepLSD File "/home/danson/Code_center/limap/third-party/DeepLSD/deeplsd/models/deeplsd_inference.py", line 12, in from ..geometry.line_utils import (merge_lines, get_line_orientation, File "/home/danson/Code_center/limap/third-party/DeepLSD/deeplsd/geometry/line_utils.py", line 13, in from ..utils.tensor import (nn_interpolate_numpy, bilinear_interpolate_numpy, File "/home/danson/Code_center/limap/third-party/DeepLSD/deeplsd/utils/tensor.py", line 3, in from torch._six import string_classes ModuleNotFoundError: No module named 'torch._six'