From 9ef532056e2f0696ee3d057604a8e675855e89e7 Mon Sep 17 00:00:00 2001 From: Steffy-zxf <48793257+Steffy-zxf@users.noreply.github.com> Date: Tue, 26 Nov 2019 19:05:55 +0800 Subject: [PATCH] close pyreader (#236) * close pyreader in senta and elmo demo --- demo/elmo/elmo_finetune.py | 1 + demo/elmo/predict.py | 1 + demo/senta/predict.py | 3 +-- demo/senta/senta_finetune.py | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/demo/elmo/elmo_finetune.py b/demo/elmo/elmo_finetune.py index e0f077c1..f39cd1ed 100644 --- a/demo/elmo/elmo_finetune.py +++ b/demo/elmo/elmo_finetune.py @@ -148,6 +148,7 @@ if __name__ == '__main__': config = hub.RunConfig( use_cuda=args.use_gpu, use_data_parallel=True, + use_pyreader=False, num_epoch=args.num_epoch, batch_size=args.batch_size, checkpoint_dir=args.checkpoint_dir, diff --git a/demo/elmo/predict.py b/demo/elmo/predict.py index 3fb9b714..c37e4aac 100644 --- a/demo/elmo/predict.py +++ b/demo/elmo/predict.py @@ -147,6 +147,7 @@ if __name__ == '__main__': config = hub.RunConfig( use_cuda=args.use_gpu, use_data_parallel=True, + use_pyreader=False, batch_size=args.batch_size, checkpoint_dir=args.checkpoint_dir, strategy=strategy) diff --git a/demo/senta/predict.py b/demo/senta/predict.py index 1c258343..dfb5017f 100644 --- a/demo/senta/predict.py +++ b/demo/senta/predict.py @@ -17,7 +17,6 @@ import paddlehub as hub parser = argparse.ArgumentParser(__doc__) parser.add_argument("--checkpoint_dir", type=str, default=None, help="Directory to model checkpoint") parser.add_argument("--use_gpu", type=ast.literal_eval, default=True, help="Whether use GPU for finetuning, input should be True or False") -parser.add_argument("--use_pyreader", type=ast.literal_eval, default=False, help="Whether use pyreader to feed data.") args = parser.parse_args() # yapf: enable. @@ -40,7 +39,7 @@ if __name__ == '__main__': config = hub.RunConfig( use_data_parallel=False, - use_pyreader=args.use_pyreader, + use_pyreader=False, use_cuda=args.use_gpu, batch_size=1, enable_memory_optim=False, diff --git a/demo/senta/senta_finetune.py b/demo/senta/senta_finetune.py index 8af5a720..49eaa171 100644 --- a/demo/senta/senta_finetune.py +++ b/demo/senta/senta_finetune.py @@ -39,6 +39,7 @@ if __name__ == '__main__': num_epoch=args.num_epoch, batch_size=args.batch_size, checkpoint_dir=args.checkpoint_dir, + use_pyreader=False, strategy=strategy) # Define a classfication finetune task by PaddleHub's API -- GitLab