From 8e6d7254a86138ed3e2e731c34a7de0b3a40b6ae Mon Sep 17 00:00:00 2001 From: TeslaZhao Date: Tue, 14 Sep 2021 21:43:09 +0800 Subject: [PATCH] fix a bug for pipeline packing --- python/pipeline/channel.py | 1 - python/pipeline/pipeline_client.py | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/python/pipeline/channel.py b/python/pipeline/channel.py index a00d8e3a..b7c229ea 100644 --- a/python/pipeline/channel.py +++ b/python/pipeline/channel.py @@ -127,7 +127,6 @@ class ChannelData(object): def get_size(self): size = 0 - dict_data = None if isinstance(self.dictdata, dict): for k in self.dictdata: size += sys.getsizeof(self.dictdata[k]) + sys.getsizeof(k) diff --git a/python/pipeline/pipeline_client.py b/python/pipeline/pipeline_client.py index 5585463e..cff7e9c3 100644 --- a/python/pipeline/pipeline_client.py +++ b/python/pipeline/pipeline_client.py @@ -108,7 +108,9 @@ class PipelineClient(object): if isinstance(value, np.ndarray): # copy shape - _LOGGER.info("value shape is {}".format(value.shape)) + _LOGGER.debug( + "key:{}, use_tensor_bytes:{}, value.shape:{}, value.dtype:{}". + format(key, use_tensor_bytes, value.shape, value.dtype)) for one_dim in value.shape: one_tensor.shape.append(one_dim) @@ -118,6 +120,7 @@ class PipelineClient(object): np.save(np_bytes, value, allow_pickle=True) one_tensor.byte_data = np_bytes.getvalue() one_tensor.elem_type = 13 #13 => bytes in proto + continue flat_value = value.flatten().tolist() # copy data -- GitLab