Skip to content

Commit 5eba85b

Browse files
authored
Merge branch 'master' into yolov4_tiny_pr
2 parents d698963 + 6e2a1d5 commit 5eba85b

File tree

1,904 files changed

+107189
-12494
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,904 files changed

+107189
-12494
lines changed

.github/bot_config.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,6 @@
2121

2222
# A list of assignees
2323
assignees:
24-
- saikumarchalla
24+
- sushreebarsa
25+
- laxmareddyp
26+
- sineeli

.github/stale.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: CI
22
on: pull_request
33

4+
permissions:
5+
contents: read
6+
47
jobs:
58
pylint:
69
runs-on: ubuntu-latest

.github/workflows/stale.yaml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Copyright 2023 The TensorFlow Authors. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
# ==============================================================================
15+
16+
# This workflow alerts and then closes the stale issues/PRs after specific time
17+
# You can adjust the behavior by modifying this file.
18+
# For more information, see:
19+
# https://github.com/actions/stale
20+
21+
name: 'Close stale issues and PRs'
22+
"on":
23+
schedule:
24+
- cron: "30 1 * * *"
25+
permissions:
26+
contents: read
27+
issues: write
28+
pull-requests: write
29+
30+
jobs:
31+
stale:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: 'actions/stale@v7'
35+
with:
36+
#Comma separated list of labels that can be assigned to issues to exclude them from being marked as stale
37+
exempt-issue-labels: 'override-stale'
38+
#Comma separated list of labels that can be assigned to PRs to exclude them from being marked as stale
39+
exempt-pr-labels: "override-stale"
40+
#Limit the No. of API calls in one run default value is 30.
41+
operations-per-run: 1000
42+
#Prevent to remove stale label when PRs or issues are updated.
43+
remove-stale-when-updated: false
44+
# comment on issue if not active for more then 7 days.
45+
stale-issue-message: 'This issue has been marked stale because it has no recent activity since 7 days. It will be closed if no further activity occurs. Thank you.'
46+
# comment on PR if not active for more then 14 days.
47+
stale-pr-message: 'This PR has been marked stale because it has no recent activity since 14 days. It will be closed if no further activity occurs. Thank you.'
48+
# comment on issue if stale for more then 7 days.
49+
close-issue-message: This issue was closed due to lack of activity after being marked stale for past 7 days.
50+
# comment on PR if stale for more then 14 days.
51+
close-pr-message: This PR was closed due to lack of activity after being marked stale for past 14 days.
52+
# Number of days of inactivity before an Issue Request becomes stale
53+
days-before-issue-stale: 7
54+
# Number of days of inactivity before a stale Issue is closed
55+
days-before-issue-close: 7
56+
# reason for closed the issue default value is not_planned
57+
close-issue-reason: completed
58+
# Number of days of inactivity before a stale PR is closed
59+
days-before-pr-close: 14
60+
# Number of days of inactivity before an PR Request becomes stale
61+
days-before-pr-stale: 14
62+
# Check for label to stale or close the issue/PR
63+
any-of-labels: 'stat:awaiting response'
64+
# override stale to stalled for PR
65+
stale-pr-label: 'stale'
66+
# override stale to stalled for Issue
67+
stale-issue-label: "stale"

CODEOWNERS

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
* @tensorflow/tf-model-garden-team
2-
/official/ @rachellj218 @saberkun @jaeyounkim
3-
/official/nlp/ @saberkun @lehougoogle @rachellj218 @jaeyounkim
2+
/official/ @rachellj218 @saberkun
3+
/official/nlp/ @saberkun @lehougoogle @rachellj218
44
/official/recommendation/ranking/ @gagika
5-
/official/vision/ @xianzhidu @yeqingli @arashwan @saberkun @rachellj218 @jaeyounkim
6-
/official/vision/beta/projects/assemblenet/ @mryoo @yeqingli
7-
/official/vision/beta/projects/deepmac_maskrcnn/ @vighneshbirodkar
8-
/official/vision/beta/projects/movinet/ @hyperparticle @yuanliangzhe @yeqingli
9-
/official/vision/beta/projects/simclr/ @luotigerlsx @chentingpc @saxenasaurabh
10-
/official/vision/beta/projects/video_ssl/ @richardaecn @yeqingli
5+
/official/vision/ @yeqingli @arashwan @saberkun @rachellj218
6+
/official/vision/projects/assemblenet/ @mryoo @yeqingli
7+
/official/vision/projects/deepmac_maskrcnn/ @vighneshbirodkar
8+
/official/vision/projects/movinet/ @hyperparticle @yuanliangzhe @yeqingli
9+
/official/vision/projects/simclr/ @luotigerlsx @chentingpc @saxenasaurabh
10+
/official/vision/projects/video_ssl/ @richardaecn @yeqingli
1111
/research/adversarial_text/ @rsepassi @a-dai
1212
/research/attention_ocr/ @xavigibert
1313
/research/audioset/ @plakal @dpwe
@@ -24,6 +24,6 @@
2424
/research/object_detection/ @jch1 @tombstone @pkulzc
2525
/research/pcl_rl/ @ofirnachum
2626
/research/rebar/ @gjtucker
27-
/research/seq_flow_lite/ @thunderfyc
27+
/research/seq_flow_lite/ @thunderfyc @karunreddy30
2828
/research/slim/ @sguada @marksandler2
2929
/research/vid2depth/ @rezama

README.md

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ extent possible though not all models are suitable.
2020

2121
| Directory | Description |
2222
|-----------|-------------|
23-
| [official](official) | • A collection of example implementations for SOTA models using the latest TensorFlow 2's high-level APIs<br />• Officially maintained, supported, and kept up to date with the latest TensorFlow 2 APIs by TensorFlow<br />• Reasonably optimized for fast performance while still being easy to read |
23+
| [official](official) | • A collection of example implementations for SOTA models using the latest TensorFlow 2's high-level APIs<br />• Officially maintained, supported, and kept up to date with the latest TensorFlow 2 APIs by TensorFlow<br />• Reasonably optimized for fast performance while still being easy to read<br /> For more details on the capabilities, check the guide on the [Model-garden](https://www.tensorflow.org/tfmodels)|
2424
| [research](research) | • A collection of research model implementations in TensorFlow 1 or 2 by researchers<br />• Maintained and supported by researchers |
2525
| [community](community) | • A curated list of the GitHub repositories with machine learning models and implementations powered by TensorFlow 2 |
2626
| [orbit](orbit) | • A flexible and lightweight library that users can easily use or fork when writing customized training loop code in TensorFlow 2.x. It seamlessly integrates with `tf.distribute` and supports running on different device types (CPU, GPU, and TPU). |
@@ -35,34 +35,25 @@ To install the current release of tensorflow-models, please follow any one of th
3535

3636
**tf-models-official** is the stable Model Garden package. Please check out the [releases](https://github.com/tensorflow/models/releases) to see what are available modules.
3737

38-
pip will install all models and dependencies automatically.
38+
pip3 will install all models and dependencies automatically.
3939

4040
```shell
4141
pip3 install tf-models-official
4242
```
4343

44-
If you are using nlp packages, please also install **tensorflow-text**:
45-
46-
```shell
47-
pip3 install tensorflow-text
48-
```
49-
50-
Please check out our [example](https://github.com/tensorflow/text/blob/master/docs/tutorials/fine_tune_bert.ipynb)
44+
Please check out our examples:
45+
- [basic library import](https://github.com/tensorflow/models/blob/master/tensorflow_models/tensorflow_models_pypi.ipynb)
46+
- [nlp model building](https://github.com/tensorflow/models/blob/master/docs/nlp/index.ipynb)
5147
to learn how to use a PIP package.
5248

53-
Note that **tf-models-official** may not include the latest changes in this
49+
Note that **tf-models-official** may not include the latest changes in the master branch of this
5450
github repo. To include latest changes, you may install **tf-models-nightly**,
5551
which is the nightly Model Garden package created daily automatically.
5652

5753
```shell
5854
pip3 install tf-models-nightly
5955
```
6056

61-
If you are using `nlp` packages, please also install tensorflow-text-nightly
62-
63-
```shell
64-
pip3 install tensorflow-text-nightly
65-
```
6657
</details>
6758

6859

@@ -82,6 +73,11 @@ git clone https://github.com/tensorflow/models.git
8273
export PYTHONPATH=$PYTHONPATH:/path/to/models
8374
```
8475

76+
If you are using in a Windows environment, you may need to use the following command with PowerShell:
77+
```shell
78+
$env:PYTHONPATH += ":\path\to\models"
79+
```
80+
8581
If you are using a Colab notebook, please set the Python path with os.environ.
8682

8783
```python
@@ -92,7 +88,7 @@ os.environ['PYTHONPATH'] += ":/path/to/models"
9288
3. Install other dependencies
9389

9490
```shell
95-
pip3 install --user -r official/requirements.txt
91+
pip3 install --user -r models/official/requirements.txt
9692
```
9793

9894
Finally, if you are using nlp packages, please also install

docs/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Public docs for TensorFlow Models
2+
3+
This directory contains the top-level public documentation for
4+
[TensorFlow Models](https://github.com/tensorflow/models)
5+
6+
This directory is mirrored to https://tensorflow.org/tfmodels, and is mainly
7+
concerned with documenting the tools provided in the `tensorflow_models` pip
8+
package (including `orbit`).
9+
10+
Api-reference pages are
11+
[available on the site](https://www.tensorflow.org/api_docs/more).
12+
13+
The
14+
[Official Models](https://github.com/tensorflow/models/blob/master/official/projects)
15+
and [Research Models](https://github.com/tensorflow/models/blob/master/research)
16+
directories are not described in detail here, refer to the individual project
17+
directories for more information.

docs/index.md

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
# Model Garden overview
2+
3+
The TensorFlow Model Garden provides implementations of many state-of-the-art
4+
machine learning (ML) models for vision and natural language processing (NLP),
5+
as well as workflow tools to let you quickly configure and run those models on
6+
standard datasets. Whether you are looking to benchmark performance for a
7+
well-known model, verify the results of recently released research, or extend
8+
existing models, the Model Garden can help you drive your ML research and
9+
applications forward.
10+
11+
The Model Garden includes the following resources for machine learning
12+
developers:
13+
14+
- [**Official models**](#official) for vision and NLP, maintained by Google
15+
engineers
16+
- [**Research models**](#research) published as part of ML research papers
17+
- [**Training experiment framework**](#training_framework) for fast,
18+
declarative training configuration of official models
19+
- [**Specialized ML operations**](#ops) for vision and natural language
20+
processing (NLP)
21+
- [**Model training loop**](#orbit) management with Orbit
22+
23+
These resources are built to be used with the TensorFlow Core framework and
24+
integrate with your existing TensorFlow development projects. Model
25+
Garden resources are also provided under an [open
26+
source](https://github.com/tensorflow/models/blob/master/LICENSE) license, so
27+
you can freely extend and distribute the models and tools.
28+
29+
Practical ML models are computationally intensive to train and run, and may
30+
require accelerators such as Graphical Processing Units (GPUs) and Tensor
31+
Processing Units (TPUs). Most of the models in Model Garden were trained on
32+
large datasets using TPUs. However, you can also train and run these models on
33+
GPU and CPU processors.
34+
35+
## Model Garden models
36+
37+
The machine learning models in the Model Garden include full code so you can
38+
test, train, or re-train them for research and experimentation. The Model Garden
39+
includes two primary categories of models: *official models* and *research
40+
models*.
41+
42+
### Official models {:#official}
43+
44+
The [Official Models](https://github.com/tensorflow/models/tree/master/official)
45+
repository is a collection of state-of-the-art models, with a focus on
46+
vision and natural language processing (NLP).
47+
These models are implemented using current TensorFlow 2.x high-level
48+
APIs. Model libraries in this repository are optimized for fast performance and
49+
actively maintained by Google engineers. The official models include additional
50+
metadata you can use to quickly configure experiments using the Model Garden
51+
[training experiment framework](#training_framework).
52+
53+
### Research models {:#research}
54+
55+
The [Research Models](https://github.com/tensorflow/models/tree/master/research)
56+
repository is a collection of models published as code resources for research
57+
papers. These models are implemented using both TensorFlow 1.x and 2.x. Model
58+
libraries in the research folder are supported by the code owners and the
59+
research community.
60+
61+
## Training experiment framework {:#training_framework}
62+
63+
The Model Garden training experiment framework lets you quickly assemble and run
64+
training experiments using its official models and standard datasets. The
65+
training framework uses additional metadata included with the Model Garden's
66+
official models to allow you to configure models quickly using a declarative
67+
programming model. You can define a training experiment using Python commands in
68+
the
69+
[TensorFlow Model library](https://www.tensorflow.org/api_docs/python/tfm/core)
70+
or configure training using a YAML configuration file, like this
71+
[example](https://github.com/tensorflow/models/blob/master/official/vision/configs/experiments/image_classification/imagenet_resnet50_tpu.yaml).
72+
73+
The training framework uses
74+
[`tfm.core.base_trainer.ExperimentConfig`](https://www.tensorflow.org/api_docs/python/tfm/core/base_trainer/ExperimentConfig)
75+
as the configuration object, which contains the following top-level
76+
configuration objects:
77+
78+
- [`runtime`](https://www.tensorflow.org/api_docs/python/tfm/core/base_task/RuntimeConfig):
79+
Defines the processing hardware, distribution strategy, and other
80+
performance optimizations
81+
- [`task`](https://www.tensorflow.org/api_docs/python/tfm/core/config_definitions/TaskConfig):
82+
Defines the model, training data, losses, and initialization
83+
- [`trainer`](https://www.tensorflow.org/api_docs/python/tfm/core/base_trainer/TrainerConfig):
84+
Defines the optimizer, training loops, evaluation loops, summaries, and
85+
checkpoints
86+
87+
For a complete example using the Model Garden training experiment framework, see
88+
the [Image classification with Model Garden](vision/image_classification.ipynb)
89+
tutorial. For information on the training experiment framework, check out the
90+
[TensorFlow Models API documentation](https://tensorflow.org/api_docs/python/tfm/core).
91+
If you are looking for a solution to manage training loops for your model
92+
training experiments, check out [Orbit](#orbit).
93+
94+
## Specialized ML operations {:#ops}
95+
96+
The Model Garden contains many vision and NLP operations specifically designed
97+
to execute state-of-the-art models that run efficiently on GPUs and TPUs. Review
98+
the TensorFlow Models Vision library API docs for a list of specialized
99+
[vision operations](https://www.tensorflow.org/api_docs/python/tfm/vision).
100+
Review the TensorFlow Models NLP Library API docs for a list of
101+
[NLP operations](https://www.tensorflow.org/api_docs/python/tfm/nlp). These
102+
libraries also include additional utility functions used for vision and NLP data
103+
processing, training, and model execution.
104+
105+
## Training loops with Orbit {:#orbit}
106+
107+
There are two default options for training TensorFlow models:
108+
109+
* Use the high-level Keras
110+
[Model.fit](https://www.tensorflow.org/api_docs/python/tf/keras/Model#fit)
111+
function. If your model and training procedure fit the assumptions of Keras'
112+
`Model.fit` (incremental gradient descent on batches of data) method this can
113+
be very convenient.
114+
* Write a custom training loop
115+
[with keras](https://www.tensorflow.org/guide/keras/writing_a_training_loop_from_scratch),
116+
or [without](https://www.tensorflow.org/guide/core/logistic_regression_core).
117+
You can write a custom training loop with low-level TensorFlow methods such as
118+
`tf.GradientTape` or `tf.function`. However, this approach requires a lot of
119+
boilerplate code, and doesn't do anything to simplify distributed training.
120+
121+
Orbit tries to provide a third option in between these two extremes.
122+
123+
Orbit is a flexible, lightweight library designed to make it easier to
124+
write custom training loops in TensorFlow 2.x, and works well with the Model
125+
Garden [training experiment framework](#training_framework). Orbit handles
126+
common model training tasks such as saving checkpoints, running model
127+
evaluations, and setting up summary writing. It seamlessly integrates with
128+
`tf.distribute` and supports running on different device types, including CPU,
129+
GPU, and TPU hardware. The Orbit tool is also [open
130+
source](https://github.com/tensorflow/models/blob/master/orbit/LICENSE), so you
131+
can extend and adapt to your model training needs.
132+
133+
The Orbit guide is available [here](orbit/index.ipynb).
134+
135+
Note: You can customize how the Keras API executes training. Mainly you must
136+
override the `Model.train_step` method or use `keras.callbacks` like
137+
`callbacks.ModelCheckpoint` or `callbacks.TensorBoard`. For more information
138+
about modifying the behavior of `train_step`, check out the
139+
[Customize what happens in Model.fit](https://www.tensorflow.org/guide/keras/customizing_what_happens_in_fit)
140+
page.

docs/nlp/_guide_toc.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
toc:
2+
- heading: TensorFlow Models - NLP
3+
style: divider
4+
- title: "Overview"
5+
path: /tfmodels/nlp
6+
- title: "Customize a transformer encoder"
7+
path: /tfmodels/nlp/customize_encoder
8+
- title: "Load LM checkpoints"
9+
path: /tfmodels/nlp/load_lm_ckpts

0 commit comments

Comments
 (0)