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

Object Detection API training documentation/tutorial from scratch + from retraining for TF2 #8869

Open
1 task done
grewe opened this issue Jul 15, 2020 · 6 comments
Open
1 task done

Comments

@grewe
Copy link

grewe commented Jul 15, 2020

Prerequisites

Please answer the following question for yourself before submitting an issue.

  • I checked to make sure that this feature has not been requested already.

1. The entire URL of the file you are using

https://github.com/tensorflow/models/tree/master/official/...

2. Describe the feature you request

I would like to request two simple examples training Object Detection API from scratch and a second retraining (possibly of a SSD MobileNet model...dataset don't care) --to understand how to use the new API for TF2. Without this it is extremely difficult to understand how to transition from Object Detection API under TF1 to TF2. Tensorflow has nice examples (and codelabs) for doing both for classification. Detection examples are needed and not present even for TF1 officially --for TF2 it is critical.

3. Additional context

4. Are you willing to contribute it? (Yes or No)

Yes but, need at least shell of program to begin

@grewe grewe added models:official models that come under official repository type:feature labels Jul 15, 2020
@ravikyram ravikyram added models:research models that come under research directory and removed models:official models that come under official repository labels Jul 15, 2020
@Jacobsolawetz
Copy link

@grewe I hope this can be of use to you and others searching for a minimal getting started example!

I wrote a tutorial to train EfficientDet in Google Colab with the TensorFlow 2 Object Detection API.

You can run this tutorial by changing just one line for your custom dataset import. I hope this tutorial allows newcomers to the repository to quickly get up and running with TensorFlow 2 for object detection!

In the tutorial, I write how to:

Acquire Labeled Object Detection Data
Install TensorFlow 2 Object Detection Dependencies
Download Custom TensorFlow 2 Object Detection Dataset
Write Custom TensorFlow 2 Object Detection Training Configuration
Train Custom TensorFlow 2 Object Detection Model
Export Custom TensorFlow 2 Object Detection Weights
Use Trained TensorFlow 2 Object Detection For Inference on Test Images

Specifically, to use this tutorial for retraining - it isn't the most intuitive, but you should be able to edit the config file where it is pointing to the checkpoint to point to one of your trained checkpoints. The model should pick up again from that point.

@AshishGusain17
Copy link

@grewe I hope this can be of use to you and others searching for a minimal getting started example!

I wrote a tutorial to train EfficientDet in Google Colab with the TensorFlow 2 Object Detection API.

You can run this tutorial by changing just one line for your custom dataset import. I hope this tutorial allows newcomers to the repository to quickly get up and running with TensorFlow 2 for object detection!

In the tutorial, I write how to:

Acquire Labeled Object Detection Data
Install TensorFlow 2 Object Detection Dependencies
Download Custom TensorFlow 2 Object Detection Dataset
Write Custom TensorFlow 2 Object Detection Training Configuration
Train Custom TensorFlow 2 Object Detection Model
Export Custom TensorFlow 2 Object Detection Weights
Use Trained TensorFlow 2 Object Detection For Inference on Test Images

Specifically, to use this tutorial for retraining - it isn't the most intuitive, but you should be able to edit the config file where it is pointing to the checkpoint to point to one of your trained checkpoints. The model should pick up again from that point.

@grewe I hope this can be of use to you and others searching for a minimal getting started example!

I wrote a tutorial to train EfficientDet in Google Colab with the TensorFlow 2 Object Detection API.

You can run this tutorial by changing just one line for your custom dataset import. I hope this tutorial allows newcomers to the repository to quickly get up and running with TensorFlow 2 for object detection!

In the tutorial, I write how to:

Acquire Labeled Object Detection Data
Install TensorFlow 2 Object Detection Dependencies
Download Custom TensorFlow 2 Object Detection Dataset
Write Custom TensorFlow 2 Object Detection Training Configuration
Train Custom TensorFlow 2 Object Detection Model
Export Custom TensorFlow 2 Object Detection Weights
Use Trained TensorFlow 2 Object Detection For Inference on Test Images

Specifically, to use this tutorial for retraining - it isn't the most intuitive, but you should be able to edit the config file where it is pointing to the checkpoint to point to one of your trained checkpoints. The model should pick up again from that point.

Just don't post the same comment everywhere, you haven't wrote anything worth in that so called tutorial

@Jacobsolawetz
Copy link

@AshishGusain17 that is good feedback... i'm learning with each passing day - would you be willing to share how the tutorial could have been written to be of more use to you?

@grewe
Copy link
Author

grewe commented Jul 20, 2020

@Jacobsolawetz thank you for your tutorial...I am going to look at it today/tomorrow.

@grewe
Copy link
Author

grewe commented Jul 21, 2020

@Jacobsolawetz quick question --I am trying your colab and at the same time trying to run locally (note I am a professor and often students like to train locally to get a handle on how to set things up locally first --also budgets limited --have not yet tried to teach students to make their own colabs). With this in mind, I note you have the change in the code to fix some keras code issue with the Ob. Det. API for TF2 --- I am having some trouble understanding how to do this locally ---I launch my jupyter notebook from a conda environment --but, not sure where the appropriate file /usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/utils/tf_utils.py is located. I have paths like
C:\Users\Lynne\Anaconda3\pkgs\tensorflow-base-2.1.0-eigen_py36h49b2757_0\Lib\site-packages\tensorflow_core\python\keras\utils where the tf_utils.py is located but, there are multiple paths -and more importantly --when inside of a notebook and you are doing an upgrade of tensorflow to say 2.3 --how is this effecting the location of this tf_utils.py I need to over-write with the new code you provide in the notebook. Thank you Lynne

@jaeyounkim jaeyounkim added models:research:odapi ODAPI and removed models:research models that come under research directory labels Jun 25, 2021
@Petros626
Copy link

@grewe I think if you want to use the TF OD API and train from scratch, you should delete the line with fine_tune_checkpoint , fine_tune_checkpoint_type. There you normally pass the model.ckpt, which contains the pretrained weights on a specific dataset. But careful you need maybe a huge amount of images for training from 0, because the weights are initialized randomly and need much examples to learn new weights related to your dataset

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

9 participants