Skip to content

Commit fdd2642

Browse files
Correcting some typos, formatting etc.
PiperOrigin-RevId: 438363336
1 parent 5794633 commit fdd2642

File tree

2 files changed

+31
-9
lines changed

2 files changed

+31
-9
lines changed

official/legacy/image_classification/README.md

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Image Classification
22

3-
**Warning:** the features in the `image_classification/` folder have been fully
4-
integrated into vision/beta. Please use the [new code base](../../vision/beta/README.md).
3+
**Warning:** the features in the `image_classification/` directory have been
4+
fully integrated into the [new code base](https://github.com/tensorflow/models/tree/benchmark/official/vision/modeling/backbones).
55

6-
This folder contains TF 2.0 model examples for image classification:
6+
This folder contains TF 2 model examples for image classification:
77

88
* [MNIST](#mnist)
99
* [Classifier Trainer](#classifier-trainer), a framework that uses the Keras
@@ -17,8 +17,7 @@ For more information about other types of models, please refer to this
1717

1818
## Before you begin
1919
Please make sure that you have the latest version of TensorFlow
20-
installed and
21-
[add the models folder to your Python path](/official/#running-the-models).
20+
installed and add the models folder to your Python path.
2221

2322
### ImageNet preparation
2423

@@ -70,6 +69,7 @@ available GPUs at each host.
7069
To download the data and run the MNIST sample model locally for the first time,
7170
run one of the following command:
7271

72+
<details>
7373
```bash
7474
python3 mnist_main.py \
7575
--model_dir=$MODEL_DIR \
@@ -79,9 +79,11 @@ python3 mnist_main.py \
7979
--num_gpus=$NUM_GPUS \
8080
--download
8181
```
82+
</details>
8283

8384
To train the model on a Cloud TPU, run the following command:
8485

86+
<details>
8587
```bash
8688
python3 mnist_main.py \
8789
--tpu=$TPU_NAME \
@@ -91,10 +93,10 @@ python3 mnist_main.py \
9193
--distribution_strategy=tpu \
9294
--download
9395
```
96+
</details>
9497

9598
Note: the `--download` flag is only required the first time you run the model.
9699

97-
98100
## Classifier Trainer
99101
The classifier trainer is a unified framework for running image classification
100102
models using Keras's compile/fit methods. Experiments should be provided in the
@@ -111,6 +113,8 @@ be 64 * 8 = 512, and for a v3-32, the global batch size is 64 * 32 = 2048.
111113
### ResNet50
112114

113115
#### On GPU:
116+
117+
<details>
114118
```bash
115119
python3 classifier_trainer.py \
116120
--mode=train_and_eval \
@@ -121,12 +125,15 @@ python3 classifier_trainer.py \
121125
--config_file=configs/examples/resnet/imagenet/gpu.yaml \
122126
--params_override='runtime.num_gpus=$NUM_GPUS'
123127
```
128+
</details>
124129

125130
To train on multiple hosts, each with GPUs attached using
126131
[MultiWorkerMirroredStrategy](https://www.tensorflow.org/api_docs/python/tf/distribute/experimental/MultiWorkerMirroredStrategy)
127132
please update `runtime` section in gpu.yaml
128133
(or override using `--params_override`) with:
129134

135+
<details>
136+
130137
```YAML
131138
# gpu.yaml
132139
runtime:
@@ -135,12 +142,16 @@ runtime:
135142
num_gpus: $NUM_GPUS
136143
task_index: 0
137144
```
145+
</details>
146+
138147
By having `task_index: 0` on the first host and `task_index: 1` on the second
139148
and so on. `$HOST1` and `$HOST2` are the IP addresses of the hosts, and `port`
140149
can be chosen any free port on the hosts. Only the first host will write
141150
TensorBoard Summaries and save checkpoints.
142151

143152
#### On TPU:
153+
154+
<details>
144155
```bash
145156
python3 classifier_trainer.py \
146157
--mode=train_and_eval \
@@ -152,9 +163,13 @@ python3 classifier_trainer.py \
152163
--config_file=configs/examples/resnet/imagenet/tpu.yaml
153164
```
154165

166+
</details>
167+
155168
### VGG-16
156169

157170
#### On GPU:
171+
172+
<details>
158173
```bash
159174
python3 classifier_trainer.py \
160175
--mode=train_and_eval \
@@ -166,9 +181,13 @@ python3 classifier_trainer.py \
166181
--params_override='runtime.num_gpus=$NUM_GPUS'
167182
```
168183

184+
</details>
185+
169186
### EfficientNet
170187
**Note: EfficientNet development is a work in progress.**
171188
#### On GPU:
189+
190+
<details>
172191
```bash
173192
python3 classifier_trainer.py \
174193
--mode=train_and_eval \
@@ -180,8 +199,11 @@ python3 classifier_trainer.py \
180199
--params_override='runtime.num_gpus=$NUM_GPUS'
181200
```
182201

202+
</details>
183203

184204
#### On TPU:
205+
206+
<details>
185207
```bash
186208
python3 classifier_trainer.py \
187209
--mode=train_and_eval \
@@ -192,6 +214,7 @@ python3 classifier_trainer.py \
192214
--data_dir=$DATA_DIR \
193215
--config_file=configs/examples/efficientnet/imagenet/efficientnet-b0-tpu.yaml
194216
```
217+
</details>
195218

196219
Note that the number of GPU devices can be overridden in the command line using
197220
`--params_overrides`. The TPU does not need this override as the device is fixed

official/vision/beta/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
This contents of `beta` folder is going to be deprecated soon and most of the
2-
content has been moved to[official/vision]
3-
(https://github.com/tensorflow/models/tree/master/official/vision).
1+
Contents of this `beta` folder is going to be deprecated soon and most of the
2+
content has been moved to[official/vision](https://github.com/tensorflow/models/tree/master/official/vision).

0 commit comments

Comments
 (0)