README.md 5.33 KB
Newer Older
A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
1
![Logo](https://storage.googleapis.com/model_garden_artifacts/TF_Model_Garden.png)
2

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
3
# TensorFlow Official Models
4

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
5
6
7
8
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
9

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
10
11
12
13
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.
14

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
15
## More models to come!
16

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
17
18
19
20
21
22
23
24
25
26
The team is actively developing new models.
In the near future, we will add:

* State-of-the-art language understanding models:
  More members in Transformer family
* Start-of-the-art image classification models:
  EfficientNet, MnasNet, and variants
* A set of excellent objection detection models.

## Table of Contents
27

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

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

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
38
### Computer Vision
Hongkun Yu's avatar
Hongkun Yu committed
39

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
40
41
42
43
44
45
#### Image Classification

| Model | Reference (Paper) |
|-------|-------------------|
| [MNIST](vision/image_classification) | A basic model to classify digits from the [MNIST dataset](http://yann.lecun.com/exdb/mnist/) |
| [ResNet](vision/image_classification) | [Deep Residual Learning for Image Recognition](https://arxiv.org/abs/1512.03385) |
46
| [EfficientNet](vision/image_classification) | [EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks](https://arxiv.org/abs/1905.11946) |
47

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
48
#### Object Detection and Segmentation
49

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
50
51
52
53
| Model | Reference (Paper) |
|-------|-------------------|
| [RetinaNet](vision/detection) | [Focal Loss for Dense Object Detection](https://arxiv.org/abs/1708.02002) |
| [Mask R-CNN](vision/detection) | [Mask R-CNN](https://arxiv.org/abs/1703.06870) |
54
| [ShapeMask](vision/detection) | [ShapeMask: Learning to Segment Novel Objects by Refining Shape Priors](https://arxiv.org/abs/1904.03239) |
A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
55
56

### Natural Language Processing
57

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
58
59
60
61
62
63
64
| Model | Reference (Paper) |
|-------|-------------------|
| [ALBERT (A Lite BERT)](nlp/albert) | [ALBERT: A Lite BERT for Self-supervised Learning of Language Representations](https://arxiv.org/abs/1909.11942) |
| [BERT (Bidirectional Encoder Representations from Transformers)](nlp/bert) | [BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding](https://arxiv.org/abs/1810.04805) |
| [NHNet (News Headline generation model)](nlp/nhnet) | [Generating Representative Headlines for News Stories](https://arxiv.org/abs/2001.09386) |
| [Transformer](nlp/transformer) | [Attention Is All You Need](https://arxiv.org/abs/1706.03762) |
| [XLNet](nlp/xlnet) | [XLNet: Generalized Autoregressive Pretraining for Language Understanding](https://arxiv.org/abs/1906.08237) |
65

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
66
67
68
69
70
71
72
### Recommendation

| Model | Reference (Paper) |
|-------|-------------------|
| [NCF](recommendation) | [Neural Collaborative Filtering](https://arxiv.org/abs/1708.05031) |

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

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
74
75
76
77
78
79
80
81
* The models in the master branch are developed using TensorFlow 2,
and they target the TensorFlow [nightly binaries](https://github.com/tensorflow/tensorflow#installation)
built from the
[master branch of TensorFlow](https://github.com/tensorflow/tensorflow/tree/master).
* The stable versions targeting releases of TensorFlow are available
as tagged branches or [downloadable releases](https://github.com/tensorflow/models/releases).
* Model repository version numbers match the target TensorFlow release,
such that
Hongkun Yu's avatar
Hongkun Yu committed
82
[release v2.2.0](https://github.com/tensorflow/models/releases/tag/v2.2.0)
A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
83
are compatible with
Hongkun Yu's avatar
Hongkun Yu committed
84
[TensorFlow v2.2.0](https://github.com/tensorflow/tensorflow/releases/tag/v2.2.0).
Hongkun Yu's avatar
Hongkun Yu committed
85

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

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
88
### Requirements
89

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
90
* The latest TensorFlow Model Garden release and TensorFlow 2
Hongkun Yu's avatar
Hongkun Yu committed
91
  * If you are on a version of TensorFlow earlier than 2.2, please
A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
92
upgrade your TensorFlow to [the latest TensorFlow 2](https://www.tensorflow.org/install/).
Hongkun Yu's avatar
Hongkun Yu committed
93

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
94
95
96
```shell
pip3 install tf-nightly
```
Hongkun Yu's avatar
Hongkun Yu committed
97

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
98
### Installation
Hongkun Yu's avatar
Hongkun Yu committed
99

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
100
#### Method 1: Install the TensorFlow Model Garden pip package
Hongkun Yu's avatar
Hongkun Yu committed
101

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
102
103
104
**tf-models-nightly** is the nightly Model Garden package
created daily automatically. pip will install all models
and dependencies automatically.
105

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
106
107
108
```shell
pip install tf-models-nightly
```
109

Jared T Nielsen's avatar
Jared T Nielsen committed
110
Please check out our [example](colab/fine_tuning_bert.ipynb)
A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
111
to learn how to use a PIP package.
112

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
113
#### Method 2: Clone the source
114

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
115
1. Clone the GitHub repository:
116

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
117
118
119
```shell
git clone https://github.com/tensorflow/models.git
```
120

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
121
2. Add the top-level ***/models*** folder to the Python path.
122

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
123
124
125
```shell
export PYTHONPATH=$PYTHONPATH:/path/to/models
```
126

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
127
If you are using a Colab notebook, please set the Python path with os.environ.
128

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
129
130
131
132
```python
import os
os.environ['PYTHONPATH'] += ":/path/to/models"
```
133

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
134
3. Install other dependencies
135

A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
136
137
138
```shell
pip3 install --user -r official/requirements.txt
```
Hongkun Yu's avatar
Hongkun Yu committed
139

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

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