From e27d0014bc5b49479d24b06954b44fb27d62977a Mon Sep 17 00:00:00 2001 From: MRXLT Date: Mon, 6 Apr 2020 12:05:33 +0000 Subject: [PATCH] fix cuda check --- python/examples/imdb/benchmark_batch.py | 2 +- python/paddle_serving_server_gpu/__init__.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/python/examples/imdb/benchmark_batch.py b/python/examples/imdb/benchmark_batch.py index 99b8ec56..57ee6816 100644 --- a/python/examples/imdb/benchmark_batch.py +++ b/python/examples/imdb/benchmark_batch.py @@ -64,4 +64,4 @@ result = multi_thread_runner.run(single_func, args.thread, {}) avg_cost = 0 for cost in result[0]: avg_cost += cost -print("total cost of each thread".format(avg_cost / args.thread)) +print("total cost {} s of each thread".format(avg_cost / args.thread)) diff --git a/python/paddle_serving_server_gpu/__init__.py b/python/paddle_serving_server_gpu/__init__.py index 6f0ece74..93a167b9 100644 --- a/python/paddle_serving_server_gpu/__init__.py +++ b/python/paddle_serving_server_gpu/__init__.py @@ -116,7 +116,7 @@ class Server(object): self.reload_interval_s = 10 self.module_path = os.path.dirname(paddle_serving_server.__file__) self.cur_path = os.getcwd() - self.check_cuda + self.check_cuda() self.use_local_bin = False self.gpuid = 0 @@ -144,7 +144,7 @@ class Server(object): self.bin_path = os.environ["SERVING_BIN"] def check_cuda(self): - r = os.system("whereis cuda") + r = os.system("whereis cuda > /dev/null") if r != 0: raise SystemExit( "CUDA not found, please check your environment or use cpu version by \"pip install paddle_serving_server\"" -- GitLab