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

Training on custom dataset #32

Closed
sushilkhadkaanon opened this issue Mar 14, 2023 · 3 comments
Closed

Training on custom dataset #32

sushilkhadkaanon opened this issue Mar 14, 2023 · 3 comments
Labels
question Further information is requested

Comments

@sushilkhadkaanon
Copy link

sushilkhadkaanon commented Mar 14, 2023

Could you please provide detailed instructions on training for a custom dataset? Read the Custom training page but couldn't understand anything.

@praeclarumjj3
Copy link
Member

Hi @sushilkhadkaanon, thanks for your interest in our work.

I believe the instructions are comprehensive enough, as other users (#17, #31) have been able to train on custom datasets following my instructions. I suggest you spend some more time trying to understand registering custom datasets in Detectron2 and then try preparing a custom dataset mapper.

Let me know if you have any specific issues.

@praeclarumjj3 praeclarumjj3 added the question Further information is requested label Mar 14, 2023
@sushilkhadkaanon
Copy link
Author

Hi! Thanks, I really appreciate your work. I tried following your instructions.
I added InstanceCOCOCustomNewBaselineDatasetMapper in build_train_loader of train_net.py
But where do I register my dataset?
` #

from detectron2.data.datasets import register_coco_instances

register_coco_instances("my_dataset_train", {}, "_annotations.coco.json", "custom_data/train")
register_coco_instances("my_dataset_test", {}, "_annotations.coco.json", "custom_data/train")

metadata_train = MetadataCatalog.get("my_dataset_train")
cfg.DATASETS.TRAIN = ("my_dataset_train",)
cfg.DATASETS.TEST = ("my_dataset_test",)

cfg.SOLVER.MAX_ITER = 5 

` 

Added this inside main function in train_net.py.
Now this is giving me `ModuleNotFoundError: 

  Please compile MultiScaleDeformableAttention CUDA op with the following commands:
\`cd mask2former/modeling/pixel_decoder/ops\`
\`sh make.sh\``

@praeclarumjj3
Copy link
Member

You can look at register_ade20k_instance.py for reference. You need to create a similar file for your dataset. Also, the official detectron2 guide on adding custom datasets is quite detailed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants