diff --git a/python/paddle_serving_server/serve.py b/python/paddle_serving_server/serve.py index 2fe17970d46a90fb6aa51b69279029cf2e3a4daf..91e4dab3253d35ff14b121e9784ab2fd93044114 100755 --- a/python/paddle_serving_server/serve.py +++ b/python/paddle_serving_server/serve.py @@ -99,7 +99,7 @@ def serve_args(): parser.add_argument( "--port", type=int, default=9292, help="Port of the starting gpu") parser.add_argument( - "--device", type=str, default="gpu", help="Type of device") + "--device", type=str, default="cpu", help="Type of device") parser.add_argument( "--gpu_ids", type=str, default="", nargs="+", help="gpu ids") parser.add_argument( @@ -179,9 +179,9 @@ def serve_args(): def start_gpu_card_model(gpu_mode, port, args): # pylint: disable=doc-string-missing - device = "gpu" - if gpu_mode == False: - device = "cpu" + device = "cpu" + if gpu_mode == True: + device = "gpu" thread_num = args.thread model = args.model diff --git a/python/paddle_serving_server/web_service.py b/python/paddle_serving_server/web_service.py index ac161fc1546ccaad5bc7932f99f4577133607643..b2ef5979c2ffd821936655ff2ed5182020b34eb1 100755 --- a/python/paddle_serving_server/web_service.py +++ b/python/paddle_serving_server/web_service.py @@ -134,7 +134,7 @@ class WebService(object): op_num=None, op_max_batch=None): - device = "gpu" + device = "cpu" server = Server() # only when `gpus == None`, which means it`s not set at all # we will use the self.gpus. @@ -149,6 +149,8 @@ class WebService(object): device = "arm" else: device = "cpu" + else: + device = "gpu" op_maker = OpMaker() op_seq_maker = OpSeqMaker() @@ -227,7 +229,7 @@ class WebService(object): def prepare_server(self, workdir, port=9393, - device="gpu", + device="cpu", precision="fp32", use_calib=False, use_lite=False,