From a88cc0ba69dfd8f691573e3de2369c8ac9b836f7 Mon Sep 17 00:00:00 2001 From: baojun <32073718+baojun-nervana@users.noreply.github.com> Date: Mon, 15 Apr 2019 21:24:42 -0700 Subject: [PATCH] update ngraph (#2045) * update ngraph * fix typo --- PaddleCV/image_classification/README_ngraph.md | 5 ++--- PaddleCV/image_classification/train.py | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/PaddleCV/image_classification/README_ngraph.md b/PaddleCV/image_classification/README_ngraph.md index bb819075..09abb8c5 100644 --- a/PaddleCV/image_classification/README_ngraph.md +++ b/PaddleCV/image_classification/README_ngraph.md @@ -16,7 +16,7 @@ Only support Adam optimizer yet. Short description of aforementioned steps: ## 1. Install PaddlePaddle -Follow PaddlePaddle [installation instruction](https://github.com/PaddlePaddle/models/tree/develop/fluid/PaddleCV/image_classification#installation) to install PaddlePaddle. If you [build from source](https://github.com/PaddlePaddle/FluidDoc/blob/develop/doc/fluid/beginners_guide/install/compile/compile_Ubuntu_en.md), please use the following cmake arguments and ensure to set `-DWITH_NGRAPH=ON`. +Follow PaddlePaddle [installation instruction](https://github.com/PaddlePaddle/models/tree/develop/fluid/PaddleCV/image_classification#installation) to install PaddlePaddle. If you [build from source](https://github.com/PaddlePaddle/FluidDoc/blob/develop/doc/fluid/beginners_guide/install/compile/compile_Ubuntu_en.md), please use the following cmake arguments and ensure to set `-DWITH_NGRAPH=ON`. ``` cmake .. -DCMAKE_BUILD_TYPE=Release -DWITH_GPU=OFF -DWITH_MKL=ON -DWITH_MKLDNN=ON -DWITH_NGRAPH=ON ``` @@ -35,9 +35,8 @@ export KMP_AFFINITY=granularity=fine,compact,1,0 ``` ## 3. How the benchmark script might be run. -If everything built successfully, you can run command in ResNet50 nGraph session in script [run.sh](https://github.com/PaddlePaddle/models/blob/develop/fluid/PaddleCV/image_classification/run.sh) to start the benchmark job locally. You will need to uncomment the `#ResNet50 nGraph` part of script. +If everything built successfully, you can run command in ResNet50 nGraph session in script [run.sh](https://github.com/PaddlePaddle/models/blob/develop/PaddleCV/image_classification/run.sh) to start the benchmark job locally. You will need to uncomment the `#ResNet50 nGraph` part of script. Above is training job using the nGraph, to run the inference job using the nGraph: Please download the pre-trained resnet50 model from [supported models](https://github.com/PaddlePaddle/models/tree/72dcc7c1a8d5de9d19fbd65b4143bd0d661eee2c/fluid/PaddleCV/image_classification#supported-models-and-performances) for inference script. - diff --git a/PaddleCV/image_classification/train.py b/PaddleCV/image_classification/train.py index 7707bf4a..d53eefb2 100644 --- a/PaddleCV/image_classification/train.py +++ b/PaddleCV/image_classification/train.py @@ -323,6 +323,7 @@ def train(args): train_py_reader.decorate_paddle_reader(train_reader) test_py_reader.decorate_paddle_reader(test_reader) + # use_ngraph is for CPU only, please refer to README_ngraph.md for details use_ngraph = os.getenv('FLAGS_use_ngraph') if not use_ngraph: train_exe = fluid.ParallelExecutor( -- GitLab