chore: import upstream snapshot with attribution
cffconvert / validate (push) Has been skipped
License Check / license-check (push) Failing after 2s

This commit is contained in:
wehub-resource-sync
2026-07-13 12:14:16 +08:00
commit 8a852e4b4e
36502 changed files with 9277225 additions and 0 deletions
@@ -0,0 +1,45 @@
Image classification using the ResNet50 model described in
[Deep Residual Learning for Image Recognition](https://arxiv.org/abs/1512.03385).
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 --benchmark_filter=.
# Using graph execution
python resnet50_graph_test.py --benchmark_filter=.
```
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 -- --benchmark_filter=.
# Using graph execution
bazel run -c opt --config=cuda :resnet50_graph_test -- --benchmark_filter=.
```
(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 |