-
Notifications
You must be signed in to change notification settings - Fork 211
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
Custom data set training using pre-trained weights #78
Comments
Hi! We will release some converted or detrex pretrained DINO-Swin weights recently, and the tutorials for custom datasets will be coming soon. You can also check detectron2 custom dataset tutorials here: documentation |
@rentainhe thank you for the fast reply! I have a bit of experience with detectron2 already, is the usage of detrex the same? in detectron2 I would do something like this to train:
or did you mean I only need to register data? |
Yes, we use the same training engine as detectron2. But we've adopted the newly designed LazyConfig config system which we believe will work better than the old yacs config system. After registering your own datasets, maybe you can train DETR on your custom datasets as follows:
This way may take you some time to learn the dataloader API designs in detectron2. However, with the help of LazyConfig, there's another way for you to use your own datasets. You can hack into # example
# train_loader = instantiate(cfg.dataloader.train)
train_loader = your_own_train_loader |
To put it simply, There are also some discussions on custom datasets in detectron2 here |
If you are not in a rush, we will provide tutorials about training on custom datasets as soon as possible. And if you have any other questions, leave an issue anytime if you need our help. |
@rentainhe |
We will release DINO training results in the future version if you're not in a rush. We will also provide the converter for the users to convert the weight trained from the original repo later, maybe you can use the pretrained 24 and 36epochs results by converting them from the official repo. @VCBE123 |
@rentainhe hey there! I managed to start a custom training with the new DINO weights you guys released yesterday; thank you so much for that! Now while training I'm getting the following message: I added the next line in the Your help would be much appreciated! |
Hello @alrightkami , you can set the config as follows to not filter empty annotations: dataloader.train.dataset.filter_empty = False You can refer to dino_r50_4scale_24ep.py for more details. |
@rentainhe Thank you so much! It worked. However, I have another issue now with inference. Could you please provide an example of custom image inference for the fine-tuned weights?
Update: things I tried However, it's expecting the config file to be from Detectron2's ModelZoo: 2) I also looked into the model_zoo.py code and tried to import config as follows:
but got: 3) LazyConfig also doesn't work here for me:
I'm getting:
4) When I'm trying to use detrex's config:
I'm also getting an error:
|
hello @alrightkami ! The the configs in you need to add your config here~, then you can load your own config file by using I'm reproducing your problems now and try to solve it~ And I think you can open a new issue about this problem which can make more people see this issue~, maybe others can also help you to solve this problem. |
@rentainhe Thank you for trying to help! I still wasn't able to fix the issue today and run inference. |
for the 4-th one, you can try to use: from detrex.config import get_config
cfg = get_config("common/data/coco_detr_graffiti.py").train
cfg.train.init_checkpoint = trained_model And I'm testing other case now~ |
@rentainhe I tried it, but it didn't change anything, I'm still getting the same error |
FYI: I added the config file in the configs/common, but it's not a pretty solution because it causes the problem with imports:
I fixed it when I changed |
Yes, we use absolute import path here because we want to use a unified train_net for all the models |
You can use the demo to inference your custom image or video using the pretrained weights. And more info can be found in the documentation: Inference demo with the pretrained weights. As there is no more activity, I am closing the issue~ Feel free to reopen it if necessary. Or you can leave a new issue if you meet some other problems. @alrightkami |
Hi there, thank you so much for your hard work for release.
Could you please provide a tutorial for custom data training using pre-trained weights?
And is it possible at the moment to fine-tune DINO with Swin backbones?
The text was updated successfully, but these errors were encountered: