diff --git a/framework/e2e/PaddleLT_new/engine/paddle_export.py b/framework/e2e/PaddleLT_new/engine/paddle_export.py index cf91bd9328..87ba4c566b 100644 --- a/framework/e2e/PaddleLT_new/engine/paddle_export.py +++ b/framework/e2e/PaddleLT_new/engine/paddle_export.py @@ -82,6 +82,7 @@ def jit_save(self): # paddle.jit.save(net, path=os.path.join(self.path, self.case)) paddle.jit.save(st_net, path=os.path.join(self.path, self.layername, "jit_save")) + return {"res": None} def jit_save_inputspec(self): """jit.save(layer)""" @@ -95,6 +96,7 @@ def jit_save_inputspec(self): # paddle.jit.save(net, path=os.path.join(self.path, self.case)) paddle.jit.save(st_net, path=os.path.join(self.path, self.layername, "jit_save_inputspec")) + return {"res": None} def jit_save_static_inputspec(self): """jit.save(layer)""" @@ -108,6 +110,7 @@ def jit_save_static_inputspec(self): # paddle.jit.save(net, path=os.path.join(self.path, self.case)) paddle.jit.save(st_net, path=os.path.join(self.path, self.layername, "jit_save_static_inputspec")) + return {"res": None} def jit_save_cinn(self): """jit.save(layer)""" @@ -122,6 +125,7 @@ def jit_save_cinn(self): # paddle.jit.save(net, path=os.path.join(self.path, self.case)) paddle.jit.save(cinn_net, path=os.path.join(self.path, self.layername, "jit_save_cinn")) + return {"res": None} def jit_save_cinn_inputspec(self): """jit.save(layer)""" @@ -137,6 +141,7 @@ def jit_save_cinn_inputspec(self): # paddle.jit.save(net, path=os.path.join(self.path, self.case)) paddle.jit.save(cinn_net, path=os.path.join(self.path, self.layername, "jit_save_cinn_inputspec")) + return {"res": None} def jit_save_cinn_static_inputspec(self): """jit.save(layer)""" @@ -152,3 +157,4 @@ def jit_save_cinn_static_inputspec(self): # paddle.jit.save(net, path=os.path.join(self.path, self.case)) paddle.jit.save(cinn_net, path=os.path.join(self.path, self.layername, "jit_save_cinn_static_inputspec")) + return {"res": None} diff --git a/framework/e2e/PaddleLT_new/engine/paddle_infer.py b/framework/e2e/PaddleLT_new/engine/paddle_infer.py index a3e4093eeb..170a18d056 100644 --- a/framework/e2e/PaddleLT_new/engine/paddle_infer.py +++ b/framework/e2e/PaddleLT_new/engine/paddle_infer.py @@ -63,7 +63,7 @@ def paddle_infer_gpu(self): else: output_handle = predictor.get_output_handle(output_names[0]) infer_res = output_handle.copy_to_cpu() - return {"logit": infer_res} + return {"res": {"logit": infer_res}} def paddle_infer_cpu(self): """infer load (layer)""" @@ -92,7 +92,7 @@ def paddle_infer_cpu(self): else: output_handle = predictor.get_output_handle(output_names[0]) infer_res = output_handle.copy_to_cpu() - return {"logit": infer_res} + return {"res": {"logit": infer_res}} def paddle_infer_mkldnn(self): """infer load (layer)""" @@ -123,7 +123,7 @@ def paddle_infer_mkldnn(self): else: output_handle = predictor.get_output_handle(output_names[0]) infer_res = output_handle.copy_to_cpu() - return {"logit": infer_res} + return {"res": {"logit": infer_res}} def paddle_infer_ort(self): """infer load (layer)""" @@ -153,7 +153,7 @@ def paddle_infer_ort(self): else: output_handle = predictor.get_output_handle(output_names[0]) infer_res = output_handle.copy_to_cpu() - return {"logit": infer_res} + return {"res": {"logit": infer_res}} def paddle_infer_new_exc_pir(self): """infer load (layer)""" @@ -186,4 +186,4 @@ def paddle_infer_new_exc_pir(self): else: output_handle = predictor.get_output_handle(output_names[0]) infer_res = output_handle.copy_to_cpu() - return {"logit": infer_res} + return {"res": {"logit": infer_res}} diff --git a/framework/e2e/PaddleLT_new/layertest.py b/framework/e2e/PaddleLT_new/layertest.py index 4fc4eac01a..b3ab9a6a7e 100644 --- a/framework/e2e/PaddleLT_new/layertest.py +++ b/framework/e2e/PaddleLT_new/layertest.py @@ -106,7 +106,7 @@ def _case_run(self): testing=testing, layerfile=self.layerfile, device_place_id=self.device_place_id, upstream_net=net ) res_dict[testing] = res["res"] - net = res["net"] + net = res.get("net", None) if os.environ.get("PLT_SAVE_GT") == "True": # 开启gt保存 gt_path = os.path.join("plt_gt", os.environ.get("PLT_SET_DEVICE"), testing) if not os.path.exists(gt_path):