From 0494db82e947d7bd6bd681057cd6b33ebd842999 Mon Sep 17 00:00:00 2001 From: Neo Zhang Jianyu Date: Wed, 30 Jun 2021 22:37:07 +0800 Subject: [PATCH] fix ONSAM-1387, it's workaround for LPOT new bug (#573) Co-authored-by: root --- .../LPOT-Sample-for-Tensorflow/alexnet.yaml | 2 +- .../lpot_sample_tensorflow.ipynb | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/AI-and-Analytics/Getting-Started-Samples/LPOT-Sample-for-Tensorflow/alexnet.yaml b/AI-and-Analytics/Getting-Started-Samples/LPOT-Sample-for-Tensorflow/alexnet.yaml index 84e142c1e5..239d7a6b09 100644 --- a/AI-and-Analytics/Getting-Started-Samples/LPOT-Sample-for-Tensorflow/alexnet.yaml +++ b/AI-and-Analytics/Getting-Started-Samples/LPOT-Sample-for-Tensorflow/alexnet.yaml @@ -13,5 +13,5 @@ tuning: accuracy_criterion: relative: 0.01 # the tuning target of accuracy loss percentage: 1% exit_policy: - timeout: 100 # tuning timeout (seconds) + timeout: 0 # tuning timeout (seconds) random_seed: 100 # random seed diff --git a/AI-and-Analytics/Getting-Started-Samples/LPOT-Sample-for-Tensorflow/lpot_sample_tensorflow.ipynb b/AI-and-Analytics/Getting-Started-Samples/LPOT-Sample-for-Tensorflow/lpot_sample_tensorflow.ipynb index a4703889aa..ea14e7737e 100644 --- a/AI-and-Analytics/Getting-Started-Samples/LPOT-Sample-for-Tensorflow/lpot_sample_tensorflow.ipynb +++ b/AI-and-Analytics/Getting-Started-Samples/LPOT-Sample-for-Tensorflow/lpot_sample_tensorflow.ipynb @@ -346,6 +346,15 @@ "We will execute the \"**lpot_quantize_model.py**\" to show the whole process of quantizing a model." ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "!export TF_ENABLE_MKL_NATIVE_FORMAT=0" + ] + }, { "cell_type": "code", "execution_count": null, @@ -354,7 +363,7 @@ }, "outputs": [], "source": [ - "!python lpot_quantize_model.py" + "!TF_ENABLE_MKL_NATIVE_FORMAT=0 python lpot_quantize_model.py" ] }, { @@ -558,9 +567,9 @@ ], "metadata": { "kernelspec": { - "display_name": "Python [conda env:miniconda3-vlpot] *", + "display_name": "tensorflow", "language": "python", - "name": "conda-env-miniconda3-vlpot-py" + "name": "tensorflow" }, "language_info": { "codemirror_mode": { @@ -572,7 +581,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.12" + "version": "3.7.10" } }, "nbformat": 4,