Skip to content

Commit

Permalink
Fix the error of transforms in deploy (PaddlePaddle#2490) (PaddlePadd…
Browse files Browse the repository at this point in the history
  • Loading branch information
juncaipeng committed Aug 29, 2022
1 parent 5a154b7 commit 6fabf30
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion deploy/python/collect_dynamic_shape.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ def collect_dynamic_shape(args):
# collect
progbar_val = progbar.Progbar(target=len(img_path_list))
for idx, img_path in enumerate(img_path_list):
data = np.array([cfg.transforms(img_path)[0]])
data = {'img': img_path}
data = np.array([cfg.transforms(data)['img']])
input_handle.reshape(data.shape)
input_handle.copy_from_cpu(data)

Expand Down
3 changes: 2 additions & 1 deletion deploy/python/infer.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ def auto_tune(args, imgs, img_nums):

for i in range(0, num):
if isinstance(imgs[i], str):
data = np.array([cfg.transforms(imgs[i])[0]])
data = {'img': imgs[i]}
data = np.array([cfg.transforms(data)['img']])
else:
data = imgs[i]
input_handle.reshape(data.shape)
Expand Down

0 comments on commit 6fabf30

Please sign in to comment.