Skip to content

Commit dbdd17c

Browse files
saberkuntensorflower-gardener
authored andcommitted
Move resnet cifar to benchmark models.
PiperOrigin-RevId: 292007895
1 parent 294579c commit dbdd17c

File tree

5 files changed

+8
-31
lines changed

5 files changed

+8
-31
lines changed

official/benchmark/keras_cifar_benchmark.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
from official.benchmark import keras_benchmark
2626
from official.utils.testing import benchmark_wrappers
27-
from official.vision.image_classification import resnet_cifar_main
27+
from official.benchmark.models import resnet_cifar_main
2828

2929
MIN_TOP_1_ACCURACY = 0.929
3030
MAX_TOP_1_ACCURACY = 0.938

official/vision/image_classification/resnet_cifar_main.py renamed to official/benchmark/models/resnet_cifar_main.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,16 @@
1818
from __future__ import division
1919
from __future__ import print_function
2020

21-
from absl import flags
2221
from absl import app as absl_app
22+
from absl import flags
2323
import tensorflow as tf
24-
24+
from official.benchmark.models import resnet_cifar_model
2525
from official.utils.flags import core as flags_core
2626
from official.utils.logs import logger
2727
from official.utils.misc import distribution_utils
2828
from official.utils.misc import keras_utils
2929
from official.vision.image_classification import cifar_preprocessing
3030
from official.vision.image_classification import common
31-
from official.vision.image_classification import resnet_cifar_model
3231

3332

3433
LR_SCHEDULE = [ # (multiplier, epoch to start) tuples
File renamed without changes.

official/vision/image_classification/resnet_cifar_test.py renamed to official/benchmark/models/resnet_cifar_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424

2525
from tensorflow.python.eager import context
2626
from tensorflow.python.platform import googletest
27+
from official.benchmark.models import resnet_cifar_main
2728
from official.utils.misc import keras_utils
2829
from official.utils.testing import integration
2930
from official.vision.image_classification import cifar_preprocessing
30-
from official.vision.image_classification import resnet_cifar_main
3131

3232

3333
class KerasCifarTest(googletest.TestCase):

official/vision/image_classification/README.md

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,11 @@ For more information about other types of models, please refer to this
1111
## ResNet
1212

1313
Similar to the [estimator implementation](../../r1/resnet), the Keras
14-
implementation has code for both CIFAR-10 data and ImageNet data. The CIFAR-10
15-
version uses a ResNet56 model implemented in
16-
[`resnet_cifar_model.py`](./resnet_cifar_model.py), and the ImageNet version
17-
uses a ResNet50 model implemented in [`resnet_model.py`](./resnet_model.py).
14+
implementation has code for the ImageNet dataset. The ImageNet
15+
version uses a ResNet50 model implemented in
16+
[`resnet_model.py`](./resnet_model.py).
1817

19-
To use
20-
either dataset, make sure that you have the latest version of TensorFlow
18+
Please make sure that you have the latest version of TensorFlow
2119
installed and
2220
[add the models folder to your Python path](/official/#running-the-models).
2321

@@ -28,26 +26,6 @@ installed and
2826
* ResNet50 TFHub: [feature vector](https://tfhub.dev/tensorflow/resnet_50/feature_vector/1)
2927
and [classification](https://tfhub.dev/tensorflow/resnet_50/classification/1)
3028

31-
### CIFAR-10
32-
33-
Download and extract the CIFAR-10 data. You can use the following script:
34-
```bash
35-
python ../../r1/resnet/cifar10_download_and_extract.py
36-
```
37-
38-
After you download the data, you can run the program by:
39-
40-
```bash
41-
python resnet_cifar_main.py
42-
```
43-
44-
If you did not use the default directory to download the data, specify the
45-
location with the `--data_dir` flag, like:
46-
47-
```bash
48-
python resnet_cifar_main.py --data_dir=/path/to/cifar
49-
```
50-
5129
### ImageNet Training
5230

5331
Download the ImageNet dataset and convert it to TFRecord format.

0 commit comments

Comments
 (0)