drprojects / superpoint_transformer

Official PyTorch implementation of Superpoint Transformer introduced in [ICCV'23] "Efficient 3D Semantic Segmentation with Superpoint Transformer" and SuperCluster introduced in [3DV'24 Oral] "Scalable 3D Panoptic Segmentation As Superpoint Graph Clustering"
MIT License
560 stars 72 forks source link

ValueError: Input NAG only has 1 node at level=2. Cannot compute radius-based horizontal graph #148

Closed narges-tk closed 1 month ago

narges-tk commented 1 month ago

Hi! I am getting the following error while training SuperCluster on a custom dataset. I think I should change datamodule config. So, I tried to change some of them but the error still persists. I am confused about which parameters are important in solving this error. Besides, is there any guidance on how to set them? Thanks in advance for your help!

Error executing job with overrides: ['experiment=panoptic/tree']
Traceback (most recent call last):
  File "src/train.py", line 140, in main
    metric_dict, _ = train(cfg)
  File "/home/ntakhtke/DL_models/superpoint_transformer/src/utils/utils.py", line 48, in wrap
    raise ex
  File "/home/ntakhtke/DL_models/superpoint_transformer/src/utils/utils.py", line 45, in wrap
    metric_dict, object_dict = task_func(cfg=cfg)
  File "src/train.py", line 115, in train
    trainer.fit(model=model, datamodule=datamodule, ckpt_path=cfg.get("ckpt_path"))
  File "/home/ntakhtke/miniconda3/envs/spt4/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 543, in fit
    call._call_and_handle_interrupt(
  File "/home/ntakhtke/miniconda3/envs/spt4/lib/python3.8/site-packages/pytorch_lightning/trainer/call.py", line 44, in _call_and_handle_interrupt
    return trainer_fn(*args, **kwargs)
  File "/home/ntakhtke/miniconda3/envs/spt4/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 579, in _fit_impl
    self._run(model, ckpt_path=ckpt_path)
  File "/home/ntakhtke/miniconda3/envs/spt4/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 946, in _run
    self._data_connector.prepare_data()
  File "/home/ntakhtke/miniconda3/envs/spt4/lib/python3.8/site-packages/pytorch_lightning/trainer/connectors/data_connector.py", line 93, in prepare_data
    call._call_lightning_datamodule_hook(trainer, "prepare_data")
  File "/home/ntakhtke/miniconda3/envs/spt4/lib/python3.8/site-packages/pytorch_lightning/trainer/call.py", line 181, in _call_lightning_datamodule_hook
    return fn(*args, **kwargs)
  File "/home/ntakhtke/DL_models/superpoint_transformer/src/datamodules/base.py", line 149, in prepare_data
    self.dataset_class(
  File "/home/ntakhtke/DL_models/superpoint_transformer/src/datasets/base.py", line 223, in __init__
    super().__init__(root, transform, pre_transform, pre_filter)
  File "/home/ntakhtke/miniconda3/envs/spt4/lib/python3.8/site-packages/torch_geometric/data/in_memory_dataset.py", line 57, in __init__
    super().__init__(root, transform, pre_transform, pre_filter, log)
  File "/home/ntakhtke/miniconda3/envs/spt4/lib/python3.8/site-packages/torch_geometric/data/dataset.py", line 97, in __init__
    self._process()
  File "/home/ntakhtke/DL_models/superpoint_transformer/src/datasets/base.py", line 647, in _process
    self.process()
  File "/home/ntakhtke/DL_models/superpoint_transformer/src/datasets/base.py", line 682, in process
    self._process_single_cloud(p)
  File "/home/ntakhtke/DL_models/superpoint_transformer/src/datasets/base.py", line 710, in _process_single_cloud
    nag = self.pre_transform(data)
  File "/home/ntakhtke/miniconda3/envs/spt4/lib/python3.8/site-packages/torch_geometric/transforms/compose.py", line 24, in __call__
    data = transform(data)
  File "/home/ntakhtke/DL_models/superpoint_transformer/src/transforms/transforms.py", line 23, in __call__
    return self._process(x)
  File "/home/ntakhtke/DL_models/superpoint_transformer/src/transforms/graph.py", line 659, in _process
    nag = _horizontal_graph_by_radius(
  File "/home/ntakhtke/DL_models/superpoint_transformer/src/transforms/graph.py", line 763, in _horizontal_graph_by_radius
    nag = _horizontal_graph_by_radius_for_single_level(
  File "/home/ntakhtke/DL_models/superpoint_transformer/src/transforms/graph.py", line 808, in _horizontal_graph_by_radius_for_single_level
    raise ValueError(
ValueError: Input NAG only has 1 node at level=2. Cannot compute radius-based horizontal graph.

Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.
drprojects commented 1 month ago

The error tells you that there is only 1 superpoint in your 2nd partition level. So you need more superpoints. There are several parameters you can play with for this.

To understand how the superpoint partition works and how to tune it to suit your need, make sure you completed and understood the Superpoint Transformer tutorial (slides, notebook, and video).

Also, issue #134 might be of interest to you for adjusting the superpoint partition.

On a general note, you have been opening multiple issues recently for problems specific to your own dataset. Due to the large number of requests, I cannot provide detailed support for tuning Superpoint Transformer or SuperCluster to user-specific, custom datasets. I strive to only provide support for the codebase and datasets I officially released. Besides you probably could have solved the issues you encountered yourself, had your spent a bit more time investigating them and more effort understanding the project through the existing tutorial, notebooks, docs, commented code, and past issues. Please be considerate of my time before opening an issue.

narges-tk commented 1 month ago

Thanks a lot for all of your support. Actually, I attended your webinar that day ;) I will explore the codes and play with the parameters more :)

drprojects commented 1 month ago

Thank you for your understanding 🙏