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

How to test with PoinTr on my own dataset? #11

Closed
JANEKKO opened this issue Oct 25, 2021 · 9 comments
Closed

How to test with PoinTr on my own dataset? #11

JANEKKO opened this issue Oct 25, 2021 · 9 comments

Comments

@JANEKKO
Copy link

JANEKKO commented Oct 25, 2021

Thanks a lot for your commit, could you please give some ideas on how to test with PoinTr on my own dataset?

@yuxumin
Copy link
Owner

yuxumin commented Oct 25, 2021

@JANEKKO Hi,
First, create a dataset class for your own data in the form of ShapeNet-55 dataset class here, if you align the output for __getitem__ function with other dataset in this repo, you can save the time to modify the code in runner.py.
The config file for dataset class should be define in the cfgs/dataset_configs. For example, ShapeNet55_meta_config. It will be loaded and used when initialize the dataset class if you specify the _base_ in model config, like PoinTr_on_ShapeNet55.

Second, you can create a model config folder. For example. a config folder for ShapeNet55 here. And put the meta config for PoinTr into this folder. (Do not forget to modify the dataset config in this yaml file)

Last, you can test the pretrain PoinTr by change the config file to the newly create one.

@JANEKKO
Copy link
Author

JANEKKO commented Oct 25, 2021 via email

@yuxumin
Copy link
Owner

yuxumin commented Oct 25, 2021

@JANEKKO feel free to reopen the issue if you find something difficult to cope with.

@yuxumin yuxumin closed this as completed Oct 25, 2021
@blukaz
Copy link

blukaz commented Nov 20, 2021

Hi yuxumin,

Thanks for the insights, but I get the following error:
Traceback (most recent call last): File "main.py", line 68, in <module> main() File "main.py", line 64, in main run_net(args, config, train_writer, val_writer) File "/content/drive/MyDrive/ColabNotebooks/PoinTr_setup/PoinTr/tools/runner.py", line 17, in run_net (train_sampler, train_dataloader), (_, test_dataloader) = builder.dataset_builder(args, config.dataset.train), \ File "/content/drive/MyDrive/ColabNotebooks/PoinTr_setup/PoinTr/tools/builder.py", line 14, in dataset_builder dataset = build_dataset_from_cfg(config._base_, config.others) File "/content/drive/MyDrive/ColabNotebooks/PoinTr_setup/PoinTr/datasets/build.py", line 16, in build_dataset_from_cfg return DATASETS.build(cfg, default_args = default_args) File "/content/drive/MyDrive/ColabNotebooks/PoinTr_setup/PoinTr/utils/registry.py", line 148, in build return self.build_func(*args, **kwargs, registry=self) File "/content/drive/MyDrive/ColabNotebooks/PoinTr_setup/PoinTr/utils/registry.py", line 282, in build_from_cfg f'{obj_type} is not in the {registry.name} registry') KeyError: 'SIW is not in the dataset registry'

It seems that my custom dataset doesn't get loaded into the registry:
Registry(name=dataset, items={'KITTI': <class 'datasets.KITTIDataset.KITTI'>, 'PCN': <class 'datasets.PCNDataset.PCN'>, 'ShapeNet': <class 'datasets.ShapeNet55Dataset.ShapeNet'>})

I tried to debug it in the registry.py script, but I couldn't figure out what the problem is. In line 270 it merges the new config successfully and then gets kicked out at 278.

Note: I've added the dataset config file, model config file and the python script in the datasets folder.

Thanks in advance!

@yuxumin
Copy link
Owner

yuxumin commented Nov 20, 2021

@blukaz Have you initialized your dataset class in the `datatsets/__init__.py'? For example, here

@blukaz
Copy link

blukaz commented Nov 23, 2021

@yuxumin Thanks! That did the job

@blukaz
Copy link

blukaz commented Nov 23, 2021

Here is are some additional steps for others who are trying to train the PoinTr model on their own (custom) dataset:

  • add this line in the ".datasets/init.py" script: import datasets.CUSTOMDATASETNAME
  • add the support for your dataset in the ".tools/runner.py" script: take a look at line 82 (def run_net) and line 178 (def validate) in the code
  • optional: if you need support for ".ply" files then you have to add this in ".datasets/io.py" script
  • important: don't forget to center and normalize your point cloud data

@zura-false
Copy link

Here is are some additional steps for others who are trying to train the PoinTr model on their own (custom) dataset:

  • add this line in the ".datasets/init.py" script: import datasets.CUSTOMDATASETNAME
  • add the support for your dataset in the ".tools/runner.py" script: take a look at line 82 (def run_net) and line 178 (def validate) in the code
  • optional: if you need support for ".ply" files then you have to add this in ".datasets/io.py" script
  • important: don't forget to center and normalize your point cloud data

Excuse me, have you tried training this model on a dataset of large outdoor buildings

@JANEKKO
Copy link
Author

JANEKKO commented Mar 17, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants