Skip to content

Commit 563bb38

Browse files
committed
update paddle.load
1 parent 0461a2c commit 563bb38

File tree

5 files changed

+459
-4
lines changed

5 files changed

+459
-4
lines changed

ppdettorch/process/transform/convert_paddle_to_torch_base.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
import os
1010
import paddle
1111

12+
from ppdettorch.utils.model_utils import ModelUtils
13+
1214

1315
class ConvertPaddleToTorchBase(object):
1416

@@ -24,7 +26,8 @@ def load_paddle_model(file_name, show_info=True):
2426
:param show_info:
2527
:return:
2628
"""
27-
paddle_model_params = paddle.load(file_name, return_numpy=True)
29+
# paddle_model_params = paddle.load(file_name, return_numpy=True)
30+
paddle_model_params = ModelUtils.load(file_name, return_numpy=True)
2831

2932
model_params = []
3033
for weight_name, weight_value in paddle_model_params.items():

ppdettorch/utils/constant.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Constants(object):
1313
1414
"""
1515
USER_HOME = os.path.expanduser("~")
16-
WORK_DIR = f"{USER_HOME}/shenglei/ocr/PPDetectionPytorch"
16+
WORK_DIR = f"{USER_HOME}/work/PPDetectionPytorch"
1717
# WORK_DIR = "./"
1818

1919
DATA_DIR = f"{WORK_DIR}/data"

0 commit comments

Comments
 (0)