cvg / limap

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

Example Run Error:EOFError: Ran out of input #23

Open Ever-Bright-V opened 1 year ago

Ever-Bright-V commented 1 year ago

when i run the example:

Both of them raise the problem:

============================================================================== Extracting colors

Computing visual neighbors... (n_neighbors = 100) [LOG] Start 2D line detection and description (detector = sold2, n_images = 98)... Traceback (most recent call last): File "/home/everbright/Codes/limap/runners/hypersim/fitnmerge.py", line 41, in main() File "/home/everbright/Codes/limap/runners/hypersim/fitnmerge.py", line 38, in main run_scene_hypersim(cfg, dataset, cfg["scene_id"], cam_id=cfg["cam_id"]) File "/home/everbright/Codes/limap/runners/hypersim/fitnmerge.py", line 14, in run_scene_hypersim linetracks = limap.runners.line_fitnmerge(cfg, imagecols, depths) File "/home/everbright/Codes/limap/limap/runners/line_fitnmerge.py", line 100, in line_fitnmerge all_2dsegs, = _runners.compute_2d_segs(cfg, imagecols, compute_descinfo=cfg["line2d"]["compute_descinfo"]) File "/home/everbright/Codes/limap/limap/runners/functions.py", line 136, 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/everbright/Codes/limap/limap/line2d/register_detector.py", line 16, in get_detector return SOLD2Detector(options) File "/home/everbright/Codes/limap/limap/line2d/SOLD2/sold2.py", line 16, in init self.detector = SOLD2LineDetector(weight_path=self.weight_path) File "/home/everbright/Codes/limap/limap/line2d/SOLD2/sold2_wrapper.py", line 28, in init self.initialize_line_matcher() File "/home/everbright/Codes/limap/limap/line2d/SOLD2/sold2_wrapper.py", line 38, in initialize_line_matcher self.line_matcher = LineMatcher( File "/home/everbright/Codes/limap/limap/line2d/SOLD2/model/line_matcher.py", line 31, in init checkpoint = torch.load(ckpt_path, map_location=self.device) File "/home/everbright/anaconda3/envs/LIMAP/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/everbright/anaconda3/envs/LIMAP/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

Ever-Bright-V commented 1 year ago

I briefly reviewed the code at the error point and it seems that the training model was not fully downloaded. I manually downloaded the model, placed it in the correct location, and it can run correctly.

B1ueber2y commented 1 year ago

Hi. The SOLD2 model (which you are using) should be automatically downloaded from here: https://www.polybox.ethz.ch/index.php/s/blOrW89gqSLoHOk/download, and into the directory "~/.limap/models/line2d/SOLD2/pretrained_models" by default. Maybe you can check if there is any problems with the internet connection.

Thanks a lot!

suyuzhu commented 1 year ago

I have the same problem:

python runners/hypersim/fitnmerge.py --output_dir outputs/quickstart_fitnmerge [LOG] Number of images: 98 [LOG] Output dir: outputs/quickstart_fitnmerge [LOG] Loading dir: outputs/quickstart_fitnmerge [LOG] weight dir: /home/amax/.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/08/01 11:08:07 hloc INFO] Found 98 images in root outputs/quickstart_fitnmerge/colmap_outputs/images. Traceback (most recent call last): File "/media/amax/937932d8-68af-4697-98be-e697f2901113/lijiahao/limap_ws/src/limap/runners/hypersim/fitnmerge.py", line 41, in <module> main() File "/media/amax/937932d8-68af-4697-98be-e697f2901113/lijiahao/limap_ws/src/limap/runners/hypersim/fitnmerge.py", line 38, in main run_scene_hypersim(cfg, dataset, cfg["scene_id"], cam_id=cfg["cam_id"]) File "/media/amax/937932d8-68af-4697-98be-e697f2901113/lijiahao/limap_ws/src/limap/runners/hypersim/fitnmerge.py", line 14, in run_scene_hypersim linetracks = limap.runners.line_fitnmerge(cfg, imagecols, depths) File "/media/amax/937932d8-68af-4697-98be-e697f2901113/lijiahao/limap_ws/src/limap/limap/runners/line_fitnmerge.py", line 106, in line_fitnmerge _, neighbors, ranges = _runners.compute_sfminfos(cfg, imagecols) File "/media/amax/937932d8-68af-4697-98be-e697f2901113/lijiahao/limap_ws/src/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 "/media/amax/937932d8-68af-4697-98be-e697f2901113/lijiahao/limap_ws/src/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 "/media/amax/937932d8-68af-4697-98be-e697f2901113/lijiahao/limap_ws/src/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/amax/anaconda3/envs/limap/lib/python3.9/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context return func(*args, **kwargs) File "/media/amax/937932d8-68af-4697-98be-e697f2901113/lijiahao/limap_ws/src/limap/limap/point2d/superpoint/main.py", line 55, in run_superpoint model = SuperPoint(conf['model']).eval().to(device) File "/media/amax/937932d8-68af-4697-98be-e697f2901113/lijiahao/limap_ws/src/limap/limap/point2d/superpoint/superpoint.py", line 144, in __init__ self.load_state_dict(torch.load(str(path))) File "/home/amax/anaconda3/envs/limap/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/amax/anaconda3/envs/limap/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

I've tried to find this path

~/.limap/models/line2d

but it is not appeared And I want to know which step can produce this document:

~/.limap/

And how can I download these module and fix this problem?

Thanks a lot~~