tensorflow / tensorflow/models
Train network on custom live data - e.g. tf.data.Dataset.from_generator() instead TFRecord()
@pkulzc is already working on this.
Since Dec 22, 2021.
- Dominant language
- Python
- Stars
- 77.7k
- Forks
- 44.8k
- PR merge metrics
- No merged PRs in 30d
Description
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/research/object_detection/model_main_tf2.py
2. Describe the feature you request
I would like to train a object detection network on flexible custom data using a generator instead of reading the data from a TFRecord file.
Situation: It seems so to me that the only way to create input data based on TFSamples is to create a TFRecord in advance. Then dataset builder and input reader are used to create the dataset. I would like to use a generator to create the TFSamples of the batch size for each iteration again and again. Is it possible to inject a "tf.data.Dataset.from_generator()" at some point of the training data building process?
Scenario: I have images of objects with a Mask of the object and background images. Using a random transformation I combine objects with the background images. I would like to do this procedure on the fly instead of creating all samples (>100.000 samples) in advance which needs a lot of memory. It is better for the generalization of the learning task to apply the random transformation and synthesis for each batch separately because more random combinations could be applied. Further I would like to apply custom augmentations on background and objects separately.
3. Additional context
4. Are you willing to contribute it? (Yes or No)
Yes if find a generic solution for it
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.