Skip to content

Commit

Permalink
refine
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangbo9674 committed Sep 20, 2024
1 parent 16189af commit 065e3d8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tools/model_converter/convert_paddle_to_standard.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ def convert_model(paddle_model, save_dir, params2val_dict):
graph.forward_block_idx = block.forward_block_idx

model_save_path = os.path.join(save_dir, "standard_model.model")
print("new_model: ", new_model, flush=1)
model_str = new_model.SerializeToString()
with open(model_save_path, "wb") as writable:
writable.write(model_str)
Expand All @@ -184,5 +185,7 @@ def convert_model(paddle_model, save_dir, params2val_dict):
paddle.set_device("cpu")
if not os.path.exists(args.save_dir):
os.mkdir(args.save_dir)
params2val_dict, _ = convert_params(args.paddle_model, args.save_dir)
# params2val_dict, _ = convert_params(args.paddle_model, args.save_dir)
params2val_dict = {}
convert_model(args.paddle_model, args.save_dir, params2val_dict)

0 comments on commit 065e3d8

Please sign in to comment.