STT-tensorflow/tensorflow/python/eager/benchmarks/resnet50
Xiao Yu 347fe6ece4 Use the new V2 optimizer in resnet50 benchmark.
PiperOrigin-RevId: 313687026
Change-Id: If51837cddc1a7e4d2ef70c064788a8f4a7728a6a
2020-05-28 17:04:45 -07:00
..
BUILD Enable resnet50 tfrt target. The actual tests are largely disabled. 2020-04-27 20:05:16 -07:00
README.md
hvp_test.py
resnet50.py
resnet50_graph_test.py
resnet50_test.py Use the new V2 optimizer in resnet50 benchmark. 2020-05-28 17:04:45 -07:00
resnet50_test_util.py

README.md

Image classification using the ResNet50 model described in Deep Residual Learning for Image Recognition.

Contents:

  • resnet50.py: Model definition
  • resnet50_test.py: Sanity unittests and benchmarks for using the model with eager execution enabled.
  • resnet50_graph_test.py: Sanity unittests and benchmarks when using the same model code to construct a TensorFlow graph.

Benchmarks

Using a synthetic data, run:

# Using eager execution
python resnet50_test.py --benchmarks=.

# Using graph execution
python resnet50_graph_test.py --benchmarks=.

The above uses the model definition included with the TensorFlow pip package. To build (and run benchmarks) from source:

# Using eager execution
bazel run -c opt --config=cuda :resnet50_test -- --benchmarks=.

# Using graph execution
bazel run -c opt --config=cuda :resnet50_graph_test -- --benchmarks=.

(Or remove the --config=cuda flag for running on CPU instead of GPU).

On October 31, 2017, the benchmarks demonstrated comparable performance for eager and graph execution of this particular model when using a single NVIDIA Titan X (Pascal) GPU on a host with an Intel Xeon E5-1650 CPU @ 3.50GHz and a batch size of 32.

Benchmark name batch size images/second
eager_train_gpu_batch_32_channels_first 32 171
graph_train_gpu_batch_32_channels_first 32 172