From f1f515793865c20fd5e7f096acd7b390a3208d2a Mon Sep 17 00:00:00 2001 From: mamingjie-China Date: Tue, 15 Oct 2019 20:20:57 +0800 Subject: [PATCH] fix the bug --- x2paddle/convert.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/x2paddle/convert.py b/x2paddle/convert.py index c308a51..585c829 100644 --- a/x2paddle/convert.py +++ b/x2paddle/convert.py @@ -189,14 +189,14 @@ def main(): assert args.framework is not None, "--framework is not defined(support tensorflow/caffe/onnx)" assert args.save_dir is not None, "--save_dir is not defined" - # try: - # import paddle - # v0, v1, v2 = paddle.__version__.split('.') - # if int(v0) != 1 or int(v1) < 5: - # print("paddlepaddle>=1.5.0 is required") - # return - # except: - # print("paddlepaddle not installed, use \"pip install paddlepaddle\"") + try: + import paddle + v0, v1, v2 = paddle.__version__.split('.') + if int(v0) != 1 or int(v1) < 5: + print("paddlepaddle>=1.5.0 is required") + return + except: + print("paddlepaddle not installed, use \"pip install paddlepaddle\"") if args.framework == "tensorflow": assert args.model is not None, "--model should be defined while translating tensorflow model" -- GitLab