Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Train RandLANet from Readme does not seem to work #639

Open
3 tasks done
nikste opened this issue Feb 17, 2024 · 1 comment
Open
3 tasks done

Train RandLANet from Readme does not seem to work #639

nikste opened this issue Feb 17, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@nikste
Copy link

nikste commented Feb 17, 2024

Checklist

Describe the issue

trying the code from the readme:

import ml3d
from ml3d.torch import RandLANet, SemanticSegmentation

# use a cache for storing the results of the preprocessing (default path is './logs/cache')
dataset = ml3d.datasets.SemanticKITTI(dataset_path='/path/to/SemanticKITTI/', use_cache=True)

# create the model with random initialization.
model = RandLANet()

pipeline = SemanticSegmentation(model=model, dataset=dataset, max_epoch=100)

# prints training progress in the console.
pipeline.run_train()

(after adding the imports, would be amazing if they were also included in the example code)
results in:

Traceback (most recent call last):
  File "open3d-ml/train_semseg_pipeline.py", line 15, in <module>
    pipeline.run_train()
  File "open3d-ml/ml3d/torch/pipelines/semantic_segmentation.py", line 376, in run_train
    self.optimizer, self.scheduler = model.get_optimizer(cfg)
  File "open3d-ml/ml3d/torch/models/randlanet.py", line 354, in get_optimizer
    **cfg_pipeline.optimizer)
  File "open3d-ml/ml3d/utils/config.py", line 244, in __getattr__
    return getattr(self._cfg_dict, name)
  File "open3d-ml/ml3d/utils/config.py", line 27, in __getattr__
    raise ex
AttributeError: 'ConfigDict' object has no attribute 'optimizer'

Am I doing something wrong here?

Steps to reproduce the bug

see above

Error message

Traceback (most recent call last):
  File "open3d-ml/train_semseg_pipeline.py", line 15, in <module>
    pipeline.run_train()
  File "open3d-ml/ml3d/torch/pipelines/semantic_segmentation.py", line 376, in run_train
    self.optimizer, self.scheduler = model.get_optimizer(cfg)
  File "open3d-ml/ml3d/torch/models/randlanet.py", line 354, in get_optimizer
    **cfg_pipeline.optimizer)
  File "open3d-ml/ml3d/utils/config.py", line 244, in __getattr__
    return getattr(self._cfg_dict, name)
  File "open3d-ml/ml3d/utils/config.py", line 27, in __getattr__
    raise ex
AttributeError: 'ConfigDict' object has no attribute 'optimizer'

Expected behavior

No response

Open3D, Python and System information

- Operating system: ubuntu

Additional information

No response

@nikste nikste added the bug Something isn't working label Feb 17, 2024
@nikste
Copy link
Author

nikste commented Feb 17, 2024

Changing the script to the following does seem to run through:

from open3d import _ml3d

import ml3d
from ml3d.torch import RandLANet, SemanticSegmentation

dataset_path =  '/path/to/SemanticKITTI/'
cfg_path = "ml3d/configs/randlanet_semantickitti.yml"

cfg = _ml3d.utils.Config.load_from_file(cfg_path)
dataset = ml3d.datasets.SemanticKITTI(dataset_path=dataset_path, use_cache=True)

# create the model with random initialization.
model = RandLANet(**cfg.model)

pipeline = SemanticSegmentation(model=model, dataset=dataset,   **cfg.pipeline) #max_epoch=100,

# prints training progress in the console.
pipeline.run_train()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant