Preparations
Obtaining the Dataset
This sample uses the ImageNet dataset as an example. Download the dataset from http://www.image-net.org/.
About ResNet-50
ResNet-50 is a deep residual network that can be used to classify 1000 classes of the CIFAR-10 and ImageNet datasets.
Obtaining the Original Model
The original ResNet network script is available at https://github.com/tensorflow/models/tree/r2.1_model_reference/official.
Directory Structure
├── r1 // Original model directory. │ ├── resnet // ResNet main directory. │ ├── __init__.py │ ├── imagenet_main.py // Script for training the network based on the ImageNet dataset. │ ├── imagenet_preprocessing.py // ImageNet preprocessing module. │ ├── resnet_model.py // ResNet model file. │ ├── resnet_run_loop.py // Data input processing and run loop (training, validation, and test). │ ├── README.md // Project description file. │ ├── utils │ │ ├── export.py // Data receive functions, which define the parameter format that the exported model can respond to. ├── utils │ ├── flags │ │ ├── core.py // Public APIs including the parameter definition. │ ├── logs │ │ ├── hooks_helper.py // Tool used for custom model tests and training, such as the function for calculating the number of steps per second, and the function of capturing CPU/GPU analysis information. │ │ ├── logger.py // Log tool. │ ├── misc │ │ ├── distribution_utils.py // Auxiliary functions used for running models in distributed mode. │ │ ├── model_helpers.py // Functions that can be called by models, such as functions that control whether models stop.