tree: 9401ce432cca7012547a74f14cc5c0c8f84074d3 [path history] [tgz]
  1. BUILD
  2. hvp_test.py
  3. README.md
  4. resnet50.py
  5. resnet50_graph_test.py
  6. resnet50_test.py
  7. resnet50_test_util.py
tensorflow/python/eager/benchmarks/resnet50/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 namebatch sizeimages/second
eager_train_gpu_batch_32_channels_first32171
graph_train_gpu_batch_32_channels_first32172