diff --git a/python/examples/imagenet/README.md b/python/examples/imagenet/README.md index bfe9db5ee47b6af861da1a3608870ef10a7f3d1d..9a4dfcb33365805f42db5fdb3984edd935507f7b 100644 --- a/python/examples/imagenet/README.md +++ b/python/examples/imagenet/README.md @@ -21,7 +21,7 @@ python image_http_client.py 启动server端 ``` -python image_server.py conf_and_model/serving_server_model workdir 9393 +python -m paddle_serving_server.serve --model conf_and_model/serving_server_model/ --port 9393 ``` client端进行预测 diff --git a/python/paddle_serving_client/version.py b/python/paddle_serving_client/version.py index ca18ebdf448561961e0f83d6786180482ff5a72a..e65b5b17784307b7121a0ec86c810612a78ff4b2 100644 --- a/python/paddle_serving_client/version.py +++ b/python/paddle_serving_client/version.py @@ -12,6 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. """ Paddle Serving Client version string """ -serving_client_version = "0.1.2" -serving_server_version = "0.1.2" -module_proto_version = "0.1.2" +serving_client_version = "0.1.3" +serving_server_version = "0.1.3" +module_proto_version = "0.1.3" diff --git a/python/paddle_serving_server/version.py b/python/paddle_serving_server/version.py index ca18ebdf448561961e0f83d6786180482ff5a72a..e65b5b17784307b7121a0ec86c810612a78ff4b2 100644 --- a/python/paddle_serving_server/version.py +++ b/python/paddle_serving_server/version.py @@ -12,6 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. """ Paddle Serving Client version string """ -serving_client_version = "0.1.2" -serving_server_version = "0.1.2" -module_proto_version = "0.1.2" +serving_client_version = "0.1.3" +serving_server_version = "0.1.3" +module_proto_version = "0.1.3" diff --git a/python/paddle_serving_server_gpu/serve.py b/python/paddle_serving_server_gpu/serve.py index 016815e4872177ae2718cbc0c252875f8925380d..104c9973105a6e4248b261ac03b26132f753cff5 100644 --- a/python/paddle_serving_server_gpu/serve.py +++ b/python/paddle_serving_server_gpu/serve.py @@ -17,6 +17,7 @@ Usage: Example: python -m paddle_serving_server.serve --model ./serving_server_model --port 9292 """ +import os import argparse from multiprocessing import Pool, Process from paddle_serving_server_gpu import serve_args diff --git a/python/paddle_serving_server_gpu/version.py b/python/paddle_serving_server_gpu/version.py index ca18ebdf448561961e0f83d6786180482ff5a72a..e65b5b17784307b7121a0ec86c810612a78ff4b2 100644 --- a/python/paddle_serving_server_gpu/version.py +++ b/python/paddle_serving_server_gpu/version.py @@ -12,6 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. """ Paddle Serving Client version string """ -serving_client_version = "0.1.2" -serving_server_version = "0.1.2" -module_proto_version = "0.1.2" +serving_client_version = "0.1.3" +serving_server_version = "0.1.3" +module_proto_version = "0.1.3" diff --git a/python/setup.py.client.in b/python/setup.py.client.in index 1864c53528b587207cb98c3410e79ce039e69e65..86b3c331babccd06bdc6e206866a1c43da7b27d7 100644 --- a/python/setup.py.client.in +++ b/python/setup.py.client.in @@ -23,10 +23,19 @@ from setuptools import setup, Distribution, Extension from setuptools import find_packages from setuptools import setup from paddle_serving_client.version import serving_client_version +from pkg_resources import DistributionNotFound, get_distribution + def python_version(): return [int(v) for v in platform.python_version().split(".")] +def find_package(pkgname): + try: + get_distribution(pkgname) + return True + except DistributionNotFound: + return False + def copy_lib(): os.popen('mkdir -p paddle_serving_client/lib') for lib in ['libpython2.7.so.1.0', 'libssl.so.10', 'libcrypto.so.10']: @@ -41,9 +50,12 @@ if '${PACK}' == 'ON': REQUIRED_PACKAGES = [ - 'six >= 1.10.0', 'protobuf >= 3.1.0','paddlepaddle' + 'six >= 1.10.0', 'protobuf >= 3.1.0' ] +if not find_package("paddlepaddle") and not find_package("paddlepaddle-gpu"): + REQUIRED_PACKAGES.append("paddlepaddle") + packages=['paddle_serving_client', 'paddle_serving_client.proto', 'paddle_serving_client.io', diff --git a/python/setup.py.server.in b/python/setup.py.server.in index a5be4bdc4cb46f68710e877a3e530fdd087c5ab3..97f02078806b20f41e917e0c385983a767a4df8c 100644 --- a/python/setup.py.server.in +++ b/python/setup.py.server.in @@ -22,6 +22,14 @@ from setuptools import setup, Distribution, Extension from setuptools import find_packages from setuptools import setup from paddle_serving_server.version import serving_server_version +from pkg_resources import DistributionNotFound, get_distribution + +def find_package(pkgname): + try: + get_distribution(pkgname) + return True + except DistributionNotFound: + return False def python_version(): return [int(v) for v in platform.python_version().split(".")] @@ -29,10 +37,13 @@ def python_version(): max_version, mid_version, min_version = python_version() REQUIRED_PACKAGES = [ - 'six >= 1.10.0', 'protobuf >= 3.1.0','paddlepaddle', + 'six >= 1.10.0', 'protobuf >= 3.1.0', 'paddle_serving_client', 'flask >= 1.1.1' ] +if not find_package("paddlepaddle") and not find_package("paddlepaddle-gpu"): + REQUIRED_PACKAGES.append("paddlepaddle") + packages=['paddle_serving_server', 'paddle_serving_server.proto'] diff --git a/python/setup.py.server_gpu.in b/python/setup.py.server_gpu.in index 08466e246c61c197aeb46bdbe9d43b5d28ae07a2..6a651053391b30afb71996c5073d21a5620d3320 100644 --- a/python/setup.py.server_gpu.in +++ b/python/setup.py.server_gpu.in @@ -22,6 +22,14 @@ from setuptools import setup, Distribution, Extension from setuptools import find_packages from setuptools import setup from paddle_serving_server_gpu.version import serving_server_version +from pkg_resources import DistributionNotFound, get_distribution + +def find_package(pkgname): + try: + get_distribution(pkgname) + return True + except DistributionNotFound: + return False def python_version(): return [int(v) for v in platform.python_version().split(".")] @@ -29,10 +37,13 @@ def python_version(): max_version, mid_version, min_version = python_version() REQUIRED_PACKAGES = [ - 'six >= 1.10.0', 'protobuf >= 3.1.0','paddlepaddle', - 'paddle_serving_client' + 'six >= 1.10.0', 'protobuf >= 3.1.0', + 'paddle_serving_client', 'flask >= 1.1.1' ] +if not find_package("paddlepaddle") and not find_package("paddlepaddle-gpu"): + REQUIRED_PACKAGES.append("paddlepaddle") + packages=['paddle_serving_server_gpu', 'paddle_serving_server_gpu.proto']