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
546 stars 71 forks source link

【notebook erorr】FileNotFoundError: Project root directory not found. Indicators: ('.project-root', 'setup.cfg', 'setup.py', '.git', 'pyproject.toml') #59

Closed Cocktail-salad closed 8 months ago

Cocktail-salad commented 8 months ago

Dear Damien ROBERT Hello authors, I'm having some issues running demo_s3dis.ipynb. After running the first block of code, the second block of code and its error report is as follows:

# Parse the configs using hydra
cfg = init_config(overrides=[
    "experiment=s3dis",
    "ckpt_path=logs/train/runs/2023-12-12_23-01-31/checkpoints/epoch_449.ckpt"
])
---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
Cell In[4], line 2
      1 # Parse the configs using hydra
----> 2 cfg = init_config(overrides=[
      3     "experiment=s3dis",
      4     "ckpt_path=logs/train/runs/2023-12-12_23-01-31/checkpoints/epoch_449.ckpt"
      5 ])

**File ~/The project/superpoint_transformer-master/src/utils/hydra.py:11, in init_config(config_name, overrides)
      9 def init_config(config_name='train.yaml', overrides=[]):
     10     GlobalHydra.instance().clear()
---> 11     pyrootutils.setup_root("/home/jjgw/The project/superpoint_transformer-master", pythonpath=True)
     12     with initialize(version_base='1.2', config_path="../../configs"):
     13         cfg = compose(config_name=config_name, overrides=overrides)**

File ~/anaconda3/envs/spt/lib/python3.8/site-packages/pyrootutils/pyrootutils.py:151, in setup_root(search_from, indicator, project_root_env_var, dotenv, pythonpath, cwd)
    118 def setup_root(
    119     search_from: Union[str, Path],
    120     indicator: Union[str, Iterable[str]] = (
   (...)
    130     cwd: bool = False,
    131 ) -> Path:
    132     """Combines `get_root()` and `set_root()` into one method.
    133 
    134     Recursively searches for files from the `indicators` list, starting from given path.
   (...)
    149         Path: Path to project root.
    150     """
--> 151     path = find_root(search_from, indicator)
    152     set_root(
    153         path=path,
    154         project_root_env_var=project_root_env_var,
   (...)
    157         cwd=cwd,
    158     )
    159     return path

File ~/anaconda3/envs/spt/lib/python3.8/site-packages/pyrootutils/pyrootutils.py:73, in find_root(search_from, indicator)
     70 path = _pyrootutils_recursive_search(search_from, indicator)
     72 if not path or not path.exists():
---> 73     raise FileNotFoundError(f"Project root directory not found. Indicators: {indicator}")
     75 return path
FileNotFoundError: Project root directory not found. Indicators: ('.project-root', 'setup.cfg', 'setup.py', '.git', 'pyproject.toml')

_What is certain is that the s3dis dataset can be trained perfectly, and the saved checkpoints are: /home/jjgw/The project/superpoint_transformer-master/logs/train/runs/2023-12-12_23-01-31/checkpoints. And the file_path output of the code block above is /home/jjgw/The project/superpoint_transformer-master. I changed the ckpt_path to logs/train/runs/2023-12-12_23-01-31/checkpoints/epoch_449.ckpt. One more thing, demo_nag.ipynb works just fine._

Your research has been very helpful to me! Would you please help me see what's going on?

Yours JJGW

drprojects commented 8 months ago

Hi @Cocktail-salad, have you tried passing your absolute path to your checkpoint rather than your relative path ?

# Parse the configs using hydra
cfg = init_config(overrides=[
    "experiment=s3dis",
    "ckpt_path=/home/jjgw/The project/superpoint_transformer-master/logs/train/runs/2023-12-12_23-01-31/checkpoints/epoch_449.ckpt"
])

Also have you removed or renamed the .git directory from your project root ? The pyrootutils library needs it to automatically locate the root path of your project.

uwaovo commented 8 months ago

The same error was solved by initializing the .git repository in the root directory according to the answer.

Cocktail-salad commented 8 months ago

NICE, my problem is solved, thanks, you can close it now, sir.