Commit dbdd17c4 authored by Hongkun Yu's avatar Hongkun Yu Committed by A. Unique TensorFlower
Browse files

Move resnet cifar to benchmark models.

PiperOrigin-RevId: 292007895
parent 294579ca
...@@ -24,7 +24,7 @@ import tensorflow as tf # pylint: disable=g-bad-import-order ...@@ -24,7 +24,7 @@ import tensorflow as tf # pylint: disable=g-bad-import-order
from official.benchmark import keras_benchmark from official.benchmark import keras_benchmark
from official.utils.testing import benchmark_wrappers from official.utils.testing import benchmark_wrappers
from official.vision.image_classification import resnet_cifar_main from official.benchmark.models import resnet_cifar_main
MIN_TOP_1_ACCURACY = 0.929 MIN_TOP_1_ACCURACY = 0.929
MAX_TOP_1_ACCURACY = 0.938 MAX_TOP_1_ACCURACY = 0.938
......
...@@ -18,17 +18,16 @@ from __future__ import absolute_import ...@@ -18,17 +18,16 @@ from __future__ import absolute_import
from __future__ import division from __future__ import division
from __future__ import print_function from __future__ import print_function
from absl import flags
from absl import app as absl_app from absl import app as absl_app
from absl import flags
import tensorflow as tf import tensorflow as tf
from official.benchmark.models import resnet_cifar_model
from official.utils.flags import core as flags_core from official.utils.flags import core as flags_core
from official.utils.logs import logger from official.utils.logs import logger
from official.utils.misc import distribution_utils from official.utils.misc import distribution_utils
from official.utils.misc import keras_utils from official.utils.misc import keras_utils
from official.vision.image_classification import cifar_preprocessing from official.vision.image_classification import cifar_preprocessing
from official.vision.image_classification import common from official.vision.image_classification import common
from official.vision.image_classification import resnet_cifar_model
LR_SCHEDULE = [ # (multiplier, epoch to start) tuples LR_SCHEDULE = [ # (multiplier, epoch to start) tuples
......
...@@ -24,10 +24,10 @@ import tensorflow as tf ...@@ -24,10 +24,10 @@ import tensorflow as tf
from tensorflow.python.eager import context from tensorflow.python.eager import context
from tensorflow.python.platform import googletest from tensorflow.python.platform import googletest
from official.benchmark.models import resnet_cifar_main
from official.utils.misc import keras_utils from official.utils.misc import keras_utils
from official.utils.testing import integration from official.utils.testing import integration
from official.vision.image_classification import cifar_preprocessing from official.vision.image_classification import cifar_preprocessing
from official.vision.image_classification import resnet_cifar_main
class KerasCifarTest(googletest.TestCase): class KerasCifarTest(googletest.TestCase):
......
...@@ -11,13 +11,11 @@ For more information about other types of models, please refer to this ...@@ -11,13 +11,11 @@ For more information about other types of models, please refer to this
## ResNet ## ResNet
Similar to the [estimator implementation](../../r1/resnet), the Keras Similar to the [estimator implementation](../../r1/resnet), the Keras
implementation has code for both CIFAR-10 data and ImageNet data. The CIFAR-10 implementation has code for the ImageNet dataset. The ImageNet
version uses a ResNet56 model implemented in version uses a ResNet50 model implemented in
[`resnet_cifar_model.py`](./resnet_cifar_model.py), and the ImageNet version [`resnet_model.py`](./resnet_model.py).
uses a ResNet50 model implemented in [`resnet_model.py`](./resnet_model.py).
To use Please make sure that you have the latest version of TensorFlow
either dataset, make sure that you have the latest version of TensorFlow
installed and installed and
[add the models folder to your Python path](/official/#running-the-models). [add the models folder to your Python path](/official/#running-the-models).
...@@ -28,26 +26,6 @@ installed and ...@@ -28,26 +26,6 @@ installed and
* ResNet50 TFHub: [feature vector](https://tfhub.dev/tensorflow/resnet_50/feature_vector/1) * ResNet50 TFHub: [feature vector](https://tfhub.dev/tensorflow/resnet_50/feature_vector/1)
and [classification](https://tfhub.dev/tensorflow/resnet_50/classification/1) and [classification](https://tfhub.dev/tensorflow/resnet_50/classification/1)
### CIFAR-10
Download and extract the CIFAR-10 data. You can use the following script:
```bash
python ../../r1/resnet/cifar10_download_and_extract.py
```
After you download the data, you can run the program by:
```bash
python resnet_cifar_main.py
```
If you did not use the default directory to download the data, specify the
location with the `--data_dir` flag, like:
```bash
python resnet_cifar_main.py --data_dir=/path/to/cifar
```
### ImageNet Training ### ImageNet Training
Download the ImageNet dataset and convert it to TFRecord format. Download the ImageNet dataset and convert it to TFRecord format.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment