Rename variable

This commit is contained in:
Bobholamovic 2023-06-13 20:39:58 +08:00 committed by cuicheng01
parent d6137854e2
commit b4f10436cf

View File

@ -165,8 +165,8 @@ def save_model(net,
return return
if prefix == 'best_model': if prefix == 'best_model':
uapi_best_model_path = os.path.join(model_path, 'best_model') best_model_path = os.path.join(model_path, 'best_model')
_mkdir_if_not_exist(uapi_best_model_path) _mkdir_if_not_exist(best_model_path)
_mkdir_if_not_exist(model_path) _mkdir_if_not_exist(model_path)
model_path = os.path.join(model_path, prefix) model_path = os.path.join(model_path, prefix)
@ -188,8 +188,8 @@ def save_model(net,
paddle.save(params_state_dict, model_path + ".pdparams") paddle.save(params_state_dict, model_path + ".pdparams")
if prefix == 'best_model': if prefix == 'best_model':
uapi_best_model_path = os.path.join(uapi_best_model_path, 'model') best_model_path = os.path.join(best_model_path, 'model')
paddle.save(params_state_dict, uapi_best_model_path + ".pdparams") paddle.save(params_state_dict, best_model_path + ".pdparams")
if ema is not None: if ema is not None:
paddle.save(ema.state_dict(), model_path + ".ema.pdparams") paddle.save(ema.state_dict(), model_path + ".ema.pdparams")