From e884da9ebe52f2f262857cc6e2ad39c307ada5b1 Mon Sep 17 00:00:00 2001 From: tink2123 Date: Tue, 19 May 2020 12:01:10 +0800 Subject: [PATCH] fix use_gpu=False --- doc/recognition.md | 4 ++-- tools/export_model.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/recognition.md b/doc/recognition.md index a7393cd6..a5a8119c 100644 --- a/doc/recognition.md +++ b/doc/recognition.md @@ -184,7 +184,7 @@ python3 tools/eval.py -c configs/rec/rec_chinese_lite_train.yml -o Global.checkp ``` # 预测英文结果 -python3 tools/infer_rec.py -c configs/rec/rec_chinese_lite_train.yml -o Global.checkpoints={path/to/weights}/best_accuracy TestReader.infer_img=doc/imgs_word/en/word_1.jpg +python3 tools/infer_rec.py -c configs/rec/rec_chinese_lite_train.yml -o Global.checkpoints={path/to/weights}/best_accuracy TestReader.infer_img=doc/imgs_words/en/word_1.jpg ``` 预测图片: @@ -204,7 +204,7 @@ infer_img: doc/imgs_words/en/word_1.png ``` # 预测中文结果 -python3 tools/infer_rec.py -c configs/rec/rec_chinese_lite_train.yml -o Global.checkpoints={path/to/weights}/best_accuracy TestReader.infer_img=doc/imgs_word/ch/word_1.jpg +python3 tools/infer_rec.py -c configs/rec/rec_chinese_lite_train.yml -o Global.checkpoints={path/to/weights}/best_accuracy TestReader.infer_img=doc/imgs_words/ch/word_1.jpg ``` 预测图片: diff --git a/tools/export_model.py b/tools/export_model.py index 11a2744b..555ba7b0 100644 --- a/tools/export_model.py +++ b/tools/export_model.py @@ -31,7 +31,7 @@ def set_paddle_flags(**kwargs): # NOTE(paddle-dev): All of these flags should be # set before `import paddle`. Otherwise, it would -# not take any effect. +# not take any effect. set_paddle_flags( FLAGS_eager_delete_tensor_gb=0, # enable GC to save memory ) @@ -52,7 +52,7 @@ def main(): # check if set use_gpu=True in paddlepaddle cpu version use_gpu = config['Global']['use_gpu'] - program.check_gpu(True) + program.check_gpu(use_gpu) alg = config['Global']['algorithm'] assert alg in ['EAST', 'DB', 'Rosetta', 'CRNN', 'STARNet', 'RARE'] -- GitLab