diff --git a/README.md b/README.md index 09dd30f2214048b1ec72d7116e8cac1e6983c9a0..15741458def4325c66cfb00a4061549640d367e0 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ paddlepaddle >= 1.5.0 ## 安装 ``` -pip install git+https://github.com/PaddlePaddle/X2Paddle.git@develop +pip install x2paddle --index-url=https://pypi.org/simple/ ``` ## 使用方法 diff --git a/setup.py b/setup.py index e3171b3284e2ef9d00c934314223d671a0638d71..3470161b4d7620745cf4d7e206599447d7a399a3 100644 --- a/setup.py +++ b/setup.py @@ -1,13 +1,20 @@ import setuptools +import x2paddle + +long_description = "X2Paddle is a toolkit for converting trained model to PaddlePaddle from other deep learning frameworks.\n\n" +long_description += "Usage: x2paddle --framework tensorflow --model tf_model.pb --save_dir paddle_model\n" +long_description += "GitHub: https://github.com/PaddlePaddle/X2Paddle\n" +long_description += "Email: dltp-sz@baidu.com" setuptools.setup( name="x2paddle", - version="0.4.0", + version=x2paddle.__version__, author="dltp-sz", author_email="dltp-sz@baidu.com", description= "a toolkit for converting trained model to PaddlePaddle from other deep learning frameworks.", - long_description_content_type="text/markdown", + long_description=long_description, + long_description_content_type="text/plain", url="https://github.com/PaddlePaddle/x2paddle", packages=setuptools.find_packages(), classifiers=[ diff --git a/x2paddle/__init__.py b/x2paddle/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..3d26edf777ed646f93a5251a6de0c443c106c694 100644 --- a/x2paddle/__init__.py +++ b/x2paddle/__init__.py @@ -0,0 +1 @@ +__version__ = "0.4.1" diff --git a/x2paddle/convert.py b/x2paddle/convert.py index c6046387423b73a428e8fcdb8db36ab3a9e8a82e..c68fb6286d4da374ab4acb487fecd779e198ca0a 100644 --- a/x2paddle/convert.py +++ b/x2paddle/convert.py @@ -15,6 +15,7 @@ from six import text_type as _text_type import argparse import sys +import x2paddle def arg_parser(): @@ -49,6 +50,12 @@ def arg_parser(): type=_text_type, default=None, help="caffe proto file of caffe model") + parser.add_argument("--version", + "-v", + action="store_true", + default=False, + help="get version of x2paddle") + return parser @@ -112,12 +119,16 @@ def caffe2paddle(proto, weight, save_dir, caffe_proto): def main(): if len(sys.argv) < 2: - print("Use \"x2paddle -h\" to print the help information") + print("Use \"x2paddle -h\" to print the help information\n") return parser = arg_parser() args = parser.parse_args() + if args.version: + print("x2paddle-{} with python>=3.5\n".format(x2paddle.__version__)) + return + try: import paddle v0, v1, v2 = paddle.__version__.split('.')