提交 fdc47a42 编写于 作者: Y Yibing Liu

Remove redundant if condition

上级 6d290cec
...@@ -67,13 +67,13 @@ def infer(args): ...@@ -67,13 +67,13 @@ def infer(args):
""" Get one batch of feature data and predicts labels for each sample. """ Get one batch of feature data and predicts labels for each sample.
""" """
if args.model_save_path is None or \ if not os.path.exists(args.model_save_path):
not os.path.exists(args.model_save_path):
raise IOError("Invalid model path!") raise IOError("Invalid model path!")
place = fluid.CUDAPlace(0) if args.device == 'GPU' else fluid.CPUPlace() place = fluid.CUDAPlace(0) if args.device == 'GPU' else fluid.CPUPlace()
exe = fluid.Executor(place) exe = fluid.Executor(place)
# load model
[infer_program, feed_dicts, [infer_program, feed_dicts,
fetch_targets] = fluid.io.load_inference_model(args.model_save_path, exe) fetch_targets] = fluid.io.load_inference_model(args.model_save_path, exe)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册