README.md 6.95 KB
Newer Older
1
2
3
<div align="center">
  <img src="https://storage.googleapis.com/tf_model_garden/tf_model_garden_logo.png">
</div>
4

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
5
# TensorFlow Official Models
6

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
7
8
9
10
The TensorFlow official models are a collection of models
that use TensorFlow’s high-level APIs.
They are intended to be well-maintained, tested, and kept up to date
with the latest TensorFlow API.
A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
11

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
12
13
14
15
They should also be reasonably optimized for fast performance while still
being easy to read.
These models are used as end-to-end tests, ensuring that the models run
with the same or improved speed and performance with each new TensorFlow build.
16

Hongkun Yu's avatar
Hongkun Yu committed
17
18
19
The API documentation of the latest stable release is published to
[tensorflow.org](https://www.tensorflow.org/api_docs/python/tfm).

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
20
## More models to come!
21

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
22
23
24
The team is actively developing new models.
In the near future, we will add:

25
26
* State-of-the-art language understanding models.
* State-of-the-art image classification models.
bhack's avatar
bhack committed
27
* State-of-the-art object detection and instance segmentation models.
28
* State-of-the-art video classification models.
A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
29
30

## Table of Contents
31

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
32
33
34
35
- [Models and Implementations](#models-and-implementations)
  * [Computer Vision](#computer-vision)
    + [Image Classification](#image-classification)
    + [Object Detection and Segmentation](#object-detection-and-segmentation)
36
    + [Video Classification](#video-classification)
A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
37
38
39
  * [Natural Language Processing](#natural-language-processing)
  * [Recommendation](#recommendation)
- [How to get started with the official models](#how-to-get-started-with-the-official-models)
40
- [Contributions](#contributions)
A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
41
42

## Models and Implementations
Hongkun Yu's avatar
Hongkun Yu committed
43

44
### [Computer Vision](vision/README.md)
Hongkun Yu's avatar
Hongkun Yu committed
45

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
46
47
48
49
#### Image Classification

| Model | Reference (Paper) |
|-------|-------------------|
Yeqing Li's avatar
Yeqing Li committed
50
51
| [ResNet](vision/MODEL_GARDEN.md) | [Deep Residual Learning for Image Recognition](https://arxiv.org/abs/1512.03385) |
| [ResNet-RS](vision/MODEL_GARDEN.md) | [Revisiting ResNets: Improved Training and Scaling Strategies](https://arxiv.org/abs/2103.07579) |
52
| [EfficientNet](vision/MODEL_GARDEN.md) | [EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks](https://arxiv.org/abs/1905.11946) |
Yeqing Li's avatar
Yeqing Li committed
53
| [Vision Transformer](vision/MODEL_GARDEN.md) | [An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale](https://arxiv.org/abs/2010.11929) |
54

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
55
#### Object Detection and Segmentation
56

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
57
58
| Model | Reference (Paper) |
|-------|-------------------|
Yeqing Li's avatar
Yeqing Li committed
59
60
61
62
| [RetinaNet](vision/MODEL_GARDEN.md) | [Focal Loss for Dense Object Detection](https://arxiv.org/abs/1708.02002) |
| [Mask R-CNN](vision/MODEL_GARDEN.md) | [Mask R-CNN](https://arxiv.org/abs/1703.06870) |
| [SpineNet](vision/MODEL_GARDEN.md) | [SpineNet: Learning Scale-Permuted Backbone for Recognition and Localization](https://arxiv.org/abs/1912.05027) |
| [Cascade RCNN-RS and RetinaNet-RS](vision/MODEL_GARDEN.md) | [Simple Training Strategies and Model Scaling for Object Detection](https://arxiv.org/abs/2107.00057)|
A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
63

64
65
66
67
68
69
#### Video Classification

| Model | Reference (Paper) |
|-------|-------------------|
| [Mobile Video Networks (MoViNets)](projects/movinet) | [MoViNets: Mobile Video Networks for Efficient Video Recognition](https://arxiv.org/abs/2103.11511) |

70
### [Natural Language Processing](nlp/README.md)
71

Hongkun Yu's avatar
Hongkun Yu committed
72
73
74
75
76
77
78
79
80
81
82
#### Pre-trained Language Model

| Model | Reference (Paper) |
|-------|-------------------|
| [ALBERT](nlp/MODEL_GARDEN.md#available-model-configs) | [ALBERT: A Lite BERT for Self-supervised Learning of Language Representations](https://arxiv.org/abs/1909.11942) |
| [BERT](nlp/MODEL_GARDEN.md#available-model-configs) | [BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding](https://arxiv.org/abs/1810.04805) |
| [ELECTRA](nlp/tasks/electra_task.py) | [ELECTRA: Pre-training Text Encoders as Discriminators Rather Than Generators](https://arxiv.org/abs/2003.10555) |


#### Neural Machine Translation

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
83
84
| Model | Reference (Paper) |
|-------|-------------------|
85
| [Transformer](nlp/MODEL_GARDEN.md#available-model-configs) | [Attention Is All You Need](https://arxiv.org/abs/1706.03762) |
Hongkun Yu's avatar
Hongkun Yu committed
86
87
88
89
90
91
92
93
94
95
96
97

#### Natural Language Generation

| Model | Reference (Paper) |
|-------|-------------------|
| [NHNet (News Headline generation model)](projects/nhnet) | [Generating Representative Headlines for News Stories](https://arxiv.org/abs/2001.09386) |


#### Knowledge Distillation

| Model | Reference (Paper) |
|-------|-------------------|
98
| [MobileBERT](projects/mobilebert) | [MobileBERT: a Compact Task-Agnostic BERT for Resource-Limited Devices](https://arxiv.org/abs/2004.02984) |
99

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
100
101
### Recommendation

102
103
104
105
106
Model                            | Reference (Paper)
-------------------------------- | -----------------
[DLRM](recommendation/ranking)   | [Deep Learning Recommendation Model for Personalization and Recommendation Systems](https://arxiv.org/abs/1906.00091)
[DCN v2](recommendation/ranking) | [Improved Deep & Cross Network and Practical Lessons for Web-scale Learning to Rank Systems](https://arxiv.org/abs/2008.13535)
[NCF](recommendation)            | [Neural Collaborative Filtering](https://arxiv.org/abs/1708.05031)
A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
107
108

## How to get started with the official models
Hongkun Yu's avatar
Hongkun Yu committed
109

110
111
112
113
114
115
116
117
118
119
120
121
122
*   The official models in the master branch are developed using
[master branch of TensorFlow 2](https://github.com/tensorflow/tensorflow/tree/master).
When you clone (the repository) or download (`pip` binary) master branch of
official models , master branch of TensorFlow gets downloaded as a
dependency. This is equivalent to the following.

```shell
pip3 install tf-models-nightly
pip3 install tensorflow-text-nightly # when model uses `nlp` packages
```

*   Incase of stable versions, targeting a specific release, Tensorflow-models
repository version numbers match with the target TensorFlow release. For
Hongkun Yu's avatar
Hongkun Yu committed
123
124
example, [TensorFlow-models v2.8.x](https://github.com/tensorflow/models/releases/tag/v2.8.0)
is compatible with [TensorFlow v2.8.x](https://github.com/tensorflow/tensorflow/releases/tag/v2.8.0).
Hongkun Yu's avatar
Hongkun Yu committed
125
This is equivalent to the following:
126
127

```shell
Hongkun Yu's avatar
Hongkun Yu committed
128
129
pip3 install tf-models-official==2.8.0
pip3 install tensorflow-text==2.8.0 # when models in uses `nlp` packages
130
```
Hongkun Yu's avatar
Hongkun Yu committed
131

Hongkun Yu's avatar
Hongkun Yu committed
132
133
Starting from 2.9.x release, we release the modeling library as
`tensorflow_models` package and users can `import tensorflow_models` directly to
Hongkun Yu's avatar
Hongkun Yu committed
134
access to the exported symbols. If you are
Hongkun Yu's avatar
Hongkun Yu committed
135
136
137
using the latest nightly version or github code directly, please follow the
docstrings in the github.

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
138
Please follow the below steps before running models in this repository.
139

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
140
### Requirements
141

142
* The latest TensorFlow Model Garden release and the latest TensorFlow 2
Hongkun Yu's avatar
Hongkun Yu committed
143
  * If you are on a version of TensorFlow earlier than 2.2, please
A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
144
upgrade your TensorFlow to [the latest TensorFlow 2](https://www.tensorflow.org/install/).
Hongkun Yu's avatar
Hongkun Yu committed
145
146
147
148
149
* Python 3.7+

Our integration tests run with Python 3.7. Although Python 3.6 should work, we
don't recommend earlier versions.

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
150
### Installation
Hongkun Yu's avatar
Hongkun Yu committed
151

152
153
Please check [here](https://github.com/tensorflow/models#Installation) for the
instructions
Chen Chen's avatar
Chen Chen committed
154

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
155
## Contributions
156

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
157
If you want to contribute, please review the [contribution guidelines](https://github.com/tensorflow/models/wiki/How-to-contribute).