diff --git a/go/serving_client/serving_client_api.go b/go/serving_client/serving_client_api.go index 3d4b95f28c869143f6a97e7fd060fc1ee84c7540..299e4bcfd5f5387e54978cf51e06c2aacbd50943 100644 --- a/go/serving_client/serving_client_api.go +++ b/go/serving_client/serving_client_api.go @@ -27,7 +27,8 @@ import ( type Tensor struct { Data []byte `json:"data"` FloatData []float32 `json:"float_data"` - IntData []int64 `json:"int_data"` + IntData []int `json:"int_data"` + Int64Data []int64 `json:"int64_data"` ElemType int `json:"elem_type"` Shape []int `json:"shape"` } @@ -116,9 +117,9 @@ func Predict(handle Handle, int_feed_map map[string][]int64, fetch []string) map for i := 0; i < len(handle.FeedAliasNames); i++ { key_i := handle.FeedAliasNames[i] var tmp Tensor - tmp.IntData = []int64{} + tmp.IntData = []int{} tmp.Shape = []int{} - tmp.IntData = int_feed_map[key_i] + tmp.Int64Data = int_feed_map[key_i] tmp.ElemType = 0 tmp.Shape = handle.FeedShapeMap[key_i] tensor_array = append(tensor_array, tmp) diff --git a/python/examples/imdb/benchmark_batch.py b/python/examples/imdb/benchmark_batch.py index 99b8ec56ca74e72cb58d81f3a55b0fe7c19e4902..57ee6816989d4a807a328342f188a7298b7772de 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 6f0ece74eeccc40eaf9676738e15e7b52b9da9ce..4cbfbf96905d3681c7e024a7a09164de9abaaea6 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("nvcc --version > /dev/null") if r != 0: raise SystemExit( "CUDA not found, please check your environment or use cpu version by \"pip install paddle_serving_server\""