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
hvp_test.py Fix for //tensorflow/python/eager/benchmarks/resnet50:* 2020-01-14 23:40:38 -08:00
README.md Automated rollback of commit c1de94204e 2019-09-24 09:49:38 -07:00
resnet50_graph_test.py Fix for //tensorflow/python/eager/benchmarks/resnet50:* 2020-01-14 23:40:38 -08:00
resnet50_test_util.py Merge pull request from ROCmSoftwarePlatform:google_upstream_resnet50 2020-01-22 12:50:38 -08:00
resnet50_test.py Use the new V2 optimizer in resnet50 benchmark. 2020-05-28 17:04:45 -07:00
resnet50.py Fix resnet50_test.py to be compatible with TF 2. 2020-03-04 15:01:33 -08:00

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