Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
c9b6b048
Commit
c9b6b048
authored
Oct 28, 2019
by
Will Cromar
Committed by
A. Unique TensorFlower
Oct 28, 2019
Browse files
Internal change
PiperOrigin-RevId: 277129545
parent
26cfa492
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
0 deletions
+55
-0
official/vision/image_classification/README.md
official/vision/image_classification/README.md
+55
-0
No files found.
official/vision/image_classification/README.md
View file @
c9b6b048
...
@@ -98,3 +98,58 @@ distributed training across the GPUs.
...
@@ -98,3 +98,58 @@ distributed training across the GPUs.
If you wish to run without
`tf.distribute.Strategy`
, you can do so by setting
If you wish to run without
`tf.distribute.Strategy`
, you can do so by setting
`--distribution_strategy=off`
.
`--distribution_strategy=off`
.
## Running on Cloud TPUs
Note: This model will
**not**
work with TPUs on Colab.
You can train the ResNet CTL model on Cloud TPUs using
`tf.distribute.TPUStrategy`
. If you are not familiar with Cloud TPUs, it is
strongly recommended that you go through the
[
quickstart
](
https://cloud.google.com/tpu/docs/quickstart
)
to learn how to
create a TPU and GCE VM.
To run ResNet model on a TPU, you must set
`--distribution_strategy=tpu`
and
`--tpu=$TPU_NAME`
, where
`$TPU_NAME`
the name of your TPU in the Cloud Console.
From a GCE VM, you can run the following command to train ResNet for one epoch
on a v2-8 or v3-8 TPU:
```
bash
python resnet_ctl_imagenet_main.py
\
--tpu
=
$TPU_NAME
\
--model_dir
=
$MODEL_DIR
\
--data_dir
=
$DATA_DIR
\
--batch_size
=
1024
\
--steps_per_loop
=
500
\
--train_epochs
=
1
\
--use_synthetic_data
=
false
\
--dtype
=
fp32
\
--enable_eager
=
true
\
--enable_tensorboard
=
false
\
--distribution_strategy
=
tpu
\
--log_steps
=
50
\
--single_l2_loss_op
=
true
\
--use_tf_function
=
true
```
To train the ResNet to convergence, run it for 90 epochs:
```
bash
python resnet_ctl_imagenet_main.py
\
--tpu
=
$TPU_NAME
\
--model_dir
=
$MODEL_DIR
\
--data_dir
=
$DATA_DIR
\
--batch_size
=
1024
\
--steps_per_loop
=
500
\
--train_epochs
=
90
\
--use_synthetic_data
=
false
\
--dtype
=
fp32
\
--enable_eager
=
true
\
--enable_tensorboard
=
false
\
--distribution_strategy
=
tpu
\
--log_steps
=
50
\
--single_l2_loss_op
=
true
\
--use_tf_function
=
true
```
Note:
`$MODEL_DIR`
and
`$DATA_DIR`
must be GCS paths.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment