提交 98a150fc 编写于 作者: J jiangjiajun

modify setup.py

上级 399b2384
...@@ -20,7 +20,7 @@ paddlepaddle >= 1.5.0 ...@@ -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/
``` ```
## 使用方法 ## 使用方法
......
import setuptools 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( setuptools.setup(
name="x2paddle", name="x2paddle",
version="0.4.0", version=x2paddle.__version__,
author="dltp-sz", author="dltp-sz",
author_email="dltp-sz@baidu.com", author_email="dltp-sz@baidu.com",
description= description=
"a toolkit for converting trained model to PaddlePaddle from other deep learning frameworks.", "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", url="https://github.com/PaddlePaddle/x2paddle",
packages=setuptools.find_packages(), packages=setuptools.find_packages(),
classifiers=[ classifiers=[
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
from six import text_type as _text_type from six import text_type as _text_type
import argparse import argparse
import sys import sys
import x2paddle
def arg_parser(): def arg_parser():
...@@ -49,6 +50,12 @@ def arg_parser(): ...@@ -49,6 +50,12 @@ def arg_parser():
type=_text_type, type=_text_type,
default=None, default=None,
help="caffe proto file of caffe model") help="caffe proto file of caffe model")
parser.add_argument("--version",
"-v",
action="store_true",
default=False,
help="get version of x2paddle")
return parser return parser
...@@ -112,12 +119,16 @@ def caffe2paddle(proto, weight, save_dir, caffe_proto): ...@@ -112,12 +119,16 @@ def caffe2paddle(proto, weight, save_dir, caffe_proto):
def main(): def main():
if len(sys.argv) < 2: 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 return
parser = arg_parser() parser = arg_parser()
args = parser.parse_args() args = parser.parse_args()
if args.version:
print("x2paddle-{} with python>=3.5\n".format(x2paddle.__version__))
return
try: try:
import paddle import paddle
v0, v1, v2 = paddle.__version__.split('.') v0, v1, v2 = paddle.__version__.split('.')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册