From 79911873dc7f46a671517973b1302cc088fd2eab Mon Sep 17 00:00:00 2001 From: jiangjiajun Date: Tue, 22 Oct 2019 12:58:33 +0000 Subject: [PATCH] fix code --- x2paddle/convert.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/x2paddle/convert.py b/x2paddle/convert.py index a7b6b90..678e66c 100644 --- a/x2paddle/convert.py +++ b/x2paddle/convert.py @@ -165,10 +165,22 @@ def main(): if args.version: import x2paddle - print("x2paddle-{} with python>=3.5, paddlepaddle>=1.5.0\n".format( + print("x2paddle-{} with python>=3.5, paddlepaddle>=1.6.1\n".format( x2paddle.__version__)) return + try: + import paddle + v0, v1, v2 = paddle.__version__.split('.') + if v0 == 0 and v1 == 0 and v2 == 0: + print("You have installed paddlepaddle-dev? We're not sure it's working for x2paddle!" + elif int(v0) != 1 or int(v1) < 6: + print("paddlepaddle>=1.6.1 is required") + return + except: + print("paddlepaddle not installed, use \"pip install paddlepaddle\"") + return + 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" -- GitLab