How to train a custom model for object detection using models/official/vision/detection?
Asked
Active
Viewed 265 times
1 Answers
0
To train a new model, the training entry is main.py.
Here are a few steps of how to add new models.
If you want to just build a simple model, say MyRetinaNet, on top of current existing components like layers, losses, existing heads, you might need to:
- Add a config template for the new model like this one.
- Add a file "my_retinanet_model.py" in the modeling folder (similar to "retinanet_model.py") and implement the model.
- Add a branch to the factory file so that you can use it in main.py.
If you want to add some fine-grained components like heads and backbones, then you need to add something to the models/official/vision/detection/modeling/architecture/ folder.
- Add a class to heads.py (for heads) or a new .py file for backbones.
- Update the factory.py accordingly.
- You might also need to change the model configs accordingly,
-
uhh, good job asking and answering your own question! curious though, are you from an official tensorflow support group? – hongsy Mar 09 '20 at 14:16
-
3Yes, we seeded this question (and answer) in order to create this new tag: tensorflow-model-garden! Thanks for noticing :-) – Mar 09 '20 at 21:34
-
@TensorflowSupport, is the codebase adapted to TensorFlow 2.X versions? – Timbus Calin Mar 18 '20 at 10:11
-
@tensorflow Support, What about training the existing models with custom dataset? I have posted a question here: [maskrcnn training error](https://stackoverflow.com/questions/61280885/tf-models-official-vision-detection-mask-rcnn-invalid-argument-indices1-63) – NVS Abhilash Apr 19 '20 at 06:41
-
@TensorflowSupport can you look into [this](https://stackoverflow.com/q/66472201/9215780) topic. You might be interested. – Innat Mar 07 '21 at 03:53