diff --git a/python/paddle_serving_server/env_check/run.py b/python/paddle_serving_server/env_check/run.py index df5a7d239ab005cef06fd8a4402e4d98171f06af..6b295554757ed3478bb8a485582a7b43af94b235 100644 --- a/python/paddle_serving_server/env_check/run.py +++ b/python/paddle_serving_server/env_check/run.py @@ -47,6 +47,7 @@ def run_test_cases(cases_list, case_type): elif res == 1: if case_name == "inference": print("{} {} environment running failure. Please refer to https://www.paddlepaddle.org.cn/install/quick?docurl=/documentation/docs/zh/install/pip/linux-pip.html to configure environment".format(case_type, case_name)) + os._exit(0) else: print("{} {} environment running failure, if you need this environment, please refer to https://github.com/PaddlePaddle/Serving/blob/HEAD/doc/Compile_CN.md to configure environment".format(case_type, case_name)) diff --git a/python/paddle_serving_server/env_check/test_fit_a_line.py b/python/paddle_serving_server/env_check/test_fit_a_line.py index 5550e49e3b4a8695acaddbc2c07c66163c08d401..ad8c21de301424586dbec4366357f910d998ba0e 100644 --- a/python/paddle_serving_server/env_check/test_fit_a_line.py +++ b/python/paddle_serving_server/env_check/test_fit_a_line.py @@ -8,10 +8,7 @@ import sys from paddle_serving_client import Client from paddle_serving_client.httpclient import HttpClient -from paddle_serving_client.io import inference_model_to_serving -from paddle_serving_app.reader import SegPostprocess from paddle_serving_app.reader import * -import paddle.inference as paddle_infer from util import * @@ -31,6 +28,11 @@ class TestFitALine(object): self.serving_util.release() def get_truth_val_by_inference(self): + try: + import paddle.inference as paddle_infer + except: + # when paddle is not installed, directly return + return data = np.array( [0.0137, -0.1136, 0.2553, -0.0692, 0.0582, -0.0727, -0.1583, -0.0584, 0.6283, 0.4919, 0.1856, 0.0795, -0.0332]).astype("float32")[np.newaxis, :] diff --git a/python/paddle_serving_server/env_check/test_uci_pipeline.py b/python/paddle_serving_server/env_check/test_uci_pipeline.py index 585ccf2afde65f04ac0c8ad65e95a638f82e0f93..1d32f4e7c7ca6684cc8c73b7bd5d120abfc63c3f 100644 --- a/python/paddle_serving_server/env_check/test_uci_pipeline.py +++ b/python/paddle_serving_server/env_check/test_uci_pipeline.py @@ -10,7 +10,6 @@ import sys from paddle_serving_server.pipeline import PipelineClient from paddle_serving_app.reader import CenterCrop, RGB2BGR, Transpose, Div, Normalize, RCNNPostprocess from paddle_serving_app.reader import Sequential, File2Image, Resize, Transpose, BGR2RGB, SegPostprocess -import paddle.inference as paddle_infer from util import * @@ -30,6 +29,11 @@ class TestUCIPipeline(object): self.serving_util.release() def get_truth_val_by_inference(self): + try: + import paddle.inference as paddle_infer + except: + # when paddle is not installed, directly return + return data = np.array( [0.0137, -0.1136, 0.2553, -0.0692, 0.0582, -0.0727, -0.1583, -0.0584, 0.6283, 0.4919, 0.1856, 0.0795, -0.0332]).astype("float32")[np.newaxis, :]