nerfstudio-project / gsplat

CUDA accelerated rasterization of gaussian splatting
https://docs.gsplat.studio/
Apache License 2.0
2.2k stars 277 forks source link

Error about pycolmap #415

Closed guwinston closed 1 month ago

guwinston commented 1 month ago

when use cameras.txt/images.txt instead of cameras.bin/images.bin as input, there are a pycolmap error:

Traceback (most recent call last):
  File "examples/simple_trainer.py", line 1062, in <module>
    cli(main, cfg, verbose=True)
  File "/root/miniforge3/envs/gwc/lib/python3.8/site-packages/gsplat/distributed.py", line 344, in cli
    process_context.join()
  File "/root/miniforge3/envs/gwc/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 189, in join
    raise ProcessRaisedException(msg, error_index, failed_process.pid)
torch.multiprocessing.spawn.ProcessRaisedException: 

-- Process 1 terminated with the following error:
Traceback (most recent call last):
  File "/root/miniforge3/envs/gwc/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 76, in _wrap
    fn(i, *args)
  File "/root/miniforge3/envs/gwc/lib/python3.8/site-packages/gsplat/distributed.py", line 295, in _distributed_worker
    fn(local_rank, world_rank, world_size, args)
  File "/root/code/gsplat/examples/simple_trainer.py", line 991, in main
    runner = Runner(local_rank, world_rank, world_size, cfg)
  File "/root/code/gsplat/examples/simple_trainer.py", line 289, in __init__
    self.parser = Parser(
  File "/root/code/gsplat/examples/datasets/colmap.py", line 52, in __init__
    manager.load_images()
  File "/root/miniforge3/envs/gwc/lib/python3.8/site-packages/pycolmap/scene_manager.py", line 135, in load_images
    self._load_images_txt(input_file)
  File "/root/miniforge3/envs/gwc/lib/python3.8/site-packages/pycolmap/scene_manager.py", line 198, in _load_images_txt
    Quaternion(np.array(map(float, data[1:5]))),
  File "/root/miniforge3/envs/gwc/lib/python3.8/site-packages/pycolmap/rotation.py", line 103, in __init__
    raise Exception('Input quaternion should be a 3- or 4-vector')
Exception: Input quaternion should be a 3- or 4-vector

Actually, Quaternion(np.array(map(float, data[1:5]))) should be Quaternion(np.array(list(map(float, data[1:5])))), and the same goes for other places.

liruilong940607 commented 1 month ago

This is a bug of https://github.com/rmbrualla/pycolmap so please raise the issue/PR there.