From 45771b9adc9937d54b72ef999e2af70ff01bd71b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Durka?= Date: Wed, 6 Feb 2019 16:07:36 +0100 Subject: [PATCH 1/7] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5ba8ed258..c326e5578 100644 --- a/README.md +++ b/README.md @@ -2,5 +2,5 @@ This repository contains a number of models optimized by Intel to run machine learning workloads on Intel® Xeon® Scalable processors. For information on -how to run key benchmarks, see the [README](https://github.com/NervanaSystems/intel-models/tree/master/benchmarks) -in the benchmarks folder. How-tos and tutorials can be found in the [docs](https://github.com/NervanaSystems/intel-models/tree/master/docs) folder. +how to run key benchmarks, see the [README](/benchmarks) +in the benchmarks folder. How-tos and tutorials can be found in the [docs](/docs) folder. From c39e7d257b7e2b9598c4d28fa447f5f3168bf9f2 Mon Sep 17 00:00:00 2001 From: Karthik Vadla Date: Wed, 6 Feb 2019 10:52:11 -0800 Subject: [PATCH 2/7] Update Readme (#4) --- docs/README.md | 6 +++--- .../tensorflow_serving/GeneralBestPractices.md | 2 +- .../image_recognition/tensorflow_serving/Tutorial.md | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/README.md b/docs/README.md index a5df66d1f..5ba4f6966 100644 --- a/docs/README.md +++ b/docs/README.md @@ -4,12 +4,12 @@ * Intel-Optimized TensorFlow (*coming soon*) * Intel-Optimized TensorFlow Serving: - * [Installation Guide](general/tensorflow_serving/InstallationGuide.md) - * [General Best Practices](general/tensorflow_serving/GeneralBestPractices.md) + * [Installation Guide](/docs/general/tensorflow_serving/InstallationGuide.md) + * [General Best Practices](/docs/general/tensorflow_serving/GeneralBestPractices.md) ## Tutorials by Use Case * Intel-Optimized TensorFlow (*coming soon*) * Intel-Optimized TensorFlow Serving: - * [Image Recognition](image_recognition/tensorflow_serving/Tutorial.md) (ResNet50 and InceptionV3) + * [Image Recognition](/docs/image_recognition/tensorflow_serving/Tutorial.md) (ResNet50 and InceptionV3) * Object Detection (*coming soon*) \ No newline at end of file diff --git a/docs/general/tensorflow_serving/GeneralBestPractices.md b/docs/general/tensorflow_serving/GeneralBestPractices.md index d8aba6474..7617b3e07 100644 --- a/docs/general/tensorflow_serving/GeneralBestPractices.md +++ b/docs/general/tensorflow_serving/GeneralBestPractices.md @@ -86,5 +86,5 @@ Figure 1. NCHW format - ***TENSORFLOW_SESSION_PARALLELISM*** = *num_physical_cores*/4 3. Use NCHW data format for images 4. See one of the hands-on tutorials for an advanced walkthrough of your use case: - * [Image Recognition](https://github.com/NervanaSystems/intel-models/blob/master/docs/image_recognition/tensorflow_serving/Tutorial.md) (ResNet50 and InceptionV3) + * [Image Recognition](/docs/image_recognition/tensorflow_serving/Tutorial.md) (ResNet50 and InceptionV3) * Object Detection (*coming soon*) \ No newline at end of file diff --git a/docs/image_recognition/tensorflow_serving/Tutorial.md b/docs/image_recognition/tensorflow_serving/Tutorial.md index 3d85b9ec0..13c62ab22 100644 --- a/docs/image_recognition/tensorflow_serving/Tutorial.md +++ b/docs/image_recognition/tensorflow_serving/Tutorial.md @@ -11,12 +11,12 @@ It also provides sample code that you can use to get your optimized TensorFlow m ## Prerequisites This tutorial assumes you have already: -* [Installed TensorFlow Serving](https://github.com/NervanaSystems/intel-models/blob/master/docs/general/tensorflow_serving/InstallationGuide.md) -* Read and understood the [General Best Practices](https://github.com/NervanaSystems/intel-models/blob/master/docs/general/tensorflow_serving/GeneralBestPractices.md), +* [Installed TensorFlow Serving](/docs/general/tensorflow_serving/InstallationGuide.md) +* Read and understood the [General Best Practices](/docs/general/tensorflow_serving/GeneralBestPractices.md), especially these sections: * **Performance Metrics** * **TensorFlow Serving Configuration Settings** -* Ran an example end-to-end using a GRPC client, such as the one in the [Installation Guide](https://github.com/NervanaSystems/intel-models/blob/master/docs/general/tensorflow_serving/InstallationGuide.md) +* Ran an example end-to-end using a GRPC client, such as the one in the [Installation Guide](/docs/general/tensorflow_serving/InstallationGuide.md#option-2-using-grpc-this-is-the-fastest-method-but-the-client-has-more-dependencies) ## Background @@ -31,8 +31,8 @@ Tuning TensorFlow Serving to take full advantage of your hardware for image reco ## Hands-on Tutorial - ResNet50 or InceptionV3 For steps 1 and 2, refer to the Intel Model Zoo FP32 benchmarks: -* [ResNet50 README](https://github.com/NervanaSystems/intel-models/tree/master/benchmarks/image_recognition/tensorflow/resnet50#fp32-inference-instructions) -* [InceptionV3 README](https://github.com/NervanaSystems/intel-models/tree/master/benchmarks/image_recognition/tensorflow/inceptionv3#fp32-inference-instructions) +* [ResNet50 README](/benchmarks/image_recognition/tensorflow/resnet50#fp32-inference-instructions) +* [InceptionV3 README](/benchmarks/image_recognition/tensorflow/inceptionv3#fp32-inference-instructions) 1. **Download the Model**: Download and extract the ResNet50 or InceptionV3 pre-trained model (FP32), using the instructions in one of the READMEs above. @@ -81,7 +81,7 @@ For steps 1 and 2, refer to the Intel Model Zoo FP32 benchmarks: For example, for a machine with `Core(s) per socket: 28` and `Socket(s): 2`, *num_physical_cores* = 28 * 2 = 56. 7. **Start the server**: Now let's start up the TensorFlow model server. To optimize overall performance, use the following recommended settings from the - [General Best Practices](https://github.com/NervanaSystems/intel-models/blob/master/docs/general/tensorflow_serving/GeneralBestPractices.md): + [General Best Practices](/docs/general/tensorflow_serving/GeneralBestPractices.md): * OMP_NUM_THREADS = *num_physical_cores* * TENSORFLOW_SESSION_PARALLELISM = *num_physical_cores*/4 From fa2c68e33d0415e76ef3a5f8d2fe94c7f00c5cdb Mon Sep 17 00:00:00 2001 From: IntelAI Date: Fri, 15 Feb 2019 16:10:05 -0800 Subject: [PATCH 3/7] fix bad merge --- README.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/README.md b/README.md index 1230957f9..c326e5578 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,6 @@ # Model Zoo for Intel® Architecture -<<<<<<< HEAD This repository contains a number of models optimized by Intel to run machine learning workloads on Intel® Xeon® Scalable processors. For information on how to run key benchmarks, see the [README](/benchmarks) in the benchmarks folder. How-tos and tutorials can be found in the [docs](/docs) folder. -======= -This repository contains a number of models optimized by Intel to run machine -learning workloads on Intel® Xeon® Scalable processors. For information on -how to run key benchmarks, see the [README](/benchmarks) -in the benchmarks folder. How-tos and tutorials can be found in the [docs](/docs) folder. ->>>>>>> develop From 6d93b791eaf70dead634218f32d869ef805fdc04 Mon Sep 17 00:00:00 2001 From: Steven Robertson Date: Fri, 15 Feb 2019 16:18:15 -0800 Subject: [PATCH 4/7] Update README.md (#5) --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c326e5578..529de54dd 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Model Zoo for Intel® Architecture -This repository contains a number of models optimized by Intel to run machine -learning workloads on Intel® Xeon® Scalable processors. For information on -how to run key benchmarks, see the [README](/benchmarks) +This repository contains a number of models optimized by Intel to run machine +learning workloads on Intel® Xeon® Scalable processors. For information on +how to run key benchmarks, see the [README](/benchmarks) in the benchmarks folder. How-tos and tutorials can be found in the [docs](/docs) folder. From 5726e3ad67d341da6328de495600b0251f75d170 Mon Sep 17 00:00:00 2001 From: "Maciej \"Iwan\" Iwanowski" Date: Thu, 21 Feb 2019 17:33:26 +0100 Subject: [PATCH 5/7] Introducing --iterations argument --- .../resnet50/fp32/eval_image_classifier_inference.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/models/image_recognition/tensorflow/resnet50/fp32/eval_image_classifier_inference.py b/models/image_recognition/tensorflow/resnet50/fp32/eval_image_classifier_inference.py index da320c0c4..a66fb224b 100644 --- a/models/image_recognition/tensorflow/resnet50/fp32/eval_image_classifier_inference.py +++ b/models/image_recognition/tensorflow/resnet50/fp32/eval_image_classifier_inference.py @@ -72,6 +72,11 @@ def __init__(self): 'the benchmark will use random/dummy data.', dest="data_location", default=None) + arg_parser.add_argument('-i', "--iteration", + help='Specify the number of inference iterations.', + dest="iterations", default=40) + + arg_parser.add_argument('-r', "--accuracy-only", help='For accuracy measurement only.', dest='accuracy_only', action='store_true') @@ -129,10 +134,9 @@ def run(self): if (not self.args.accuracy_only): # performance check iteration = 0 warm_up_iteration = 10 - total_run = 40 total_time = 0 - while num_remaining_images >= self.args.batch_size and iteration < total_run: + while num_remaining_images >= self.args.batch_size and iteration < self.args.itereations: iteration += 1 # Reads and preprocess data From 99973c3f9ad7b98f794636a319bceef4cd573c84 Mon Sep 17 00:00:00 2001 From: "Maciej \"Iwan\" Iwanowski" Date: Thu, 21 Feb 2019 17:33:45 +0100 Subject: [PATCH 6/7] Fixing some typos while editing the file --- .../resnet50/fp32/eval_image_classifier_inference.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/image_recognition/tensorflow/resnet50/fp32/eval_image_classifier_inference.py b/models/image_recognition/tensorflow/resnet50/fp32/eval_image_classifier_inference.py index a66fb224b..901a260e0 100644 --- a/models/image_recognition/tensorflow/resnet50/fp32/eval_image_classifier_inference.py +++ b/models/image_recognition/tensorflow/resnet50/fp32/eval_image_classifier_inference.py @@ -82,7 +82,7 @@ def __init__(self): dest='accuracy_only', action='store_true') # parse the arguments self.args = arg_parser.parse_args() - # validate the arguements + # validate the arguments self.validate_args() def run(self): @@ -97,7 +97,7 @@ def run(self): with tf.Session(config=config) as sess: - # convert the freezed graph to optimized graph + # convert the frozen graph to optimized graph graph_def = tf.GraphDef() with tf.gfile.FastGFile(self.args.input_graph, 'rb') as input_file: input_graph_content = input_file.read() From dab0467c40658855b5a14782f858fdf37054abfb Mon Sep 17 00:00:00 2001 From: "Maciej \"Iwan\" Iwanowski" Date: Tue, 26 Feb 2019 10:20:55 +0100 Subject: [PATCH 7/7] Renaming argument --iteration to --steps --- .../fp32/eval_image_classifier_inference.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/models/image_recognition/tensorflow/resnet50/fp32/eval_image_classifier_inference.py b/models/image_recognition/tensorflow/resnet50/fp32/eval_image_classifier_inference.py index 901a260e0..7613db6f3 100644 --- a/models/image_recognition/tensorflow/resnet50/fp32/eval_image_classifier_inference.py +++ b/models/image_recognition/tensorflow/resnet50/fp32/eval_image_classifier_inference.py @@ -72,10 +72,9 @@ def __init__(self): 'the benchmark will use random/dummy data.', dest="data_location", default=None) - arg_parser.add_argument('-i', "--iteration", - help='Specify the number of inference iterations.', - dest="iterations", default=40) - + arg_parser.add_argument('-s', "--steps", + help='Specify the number of inference steps.', + dest="steps", default=40) arg_parser.add_argument('-r', "--accuracy-only", help='For accuracy measurement only.', @@ -132,12 +131,12 @@ def run(self): num_remaining_images = IMAGENET_VALIDATION_IMAGES if (not self.args.accuracy_only): # performance check - iteration = 0 + step = 0 warm_up_iteration = 10 total_time = 0 - while num_remaining_images >= self.args.batch_size and iteration < self.args.itereations: - iteration += 1 + while num_remaining_images >= self.args.batch_size and step < self.args.steps: + step += 1 # Reads and preprocess data if (self.args.data_location): @@ -153,11 +152,11 @@ def run(self): (predicts) = sess.run([output_tensor], feed_dict={input_tensor: image_np}) time_consume = time.time() - start_time - print('Iteration %d: %.3f sec' % (iteration, time_consume)) - if iteration > warm_up_iteration: + print('Iteration %d: %.3f sec' % (step, time_consume)) + if step > warm_up_iteration: total_time += time_consume - time_average = total_time / (iteration - warm_up_iteration) + time_average = total_time / (step - warm_up_iteration) print('Average time: %.3f sec' % (time_average)) print('Batch size = %d' % self.args.batch_size)