You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importppsci.utils.save_loadassave_loadOUTPUT_DIR="./output/lorenz_transformer"checkpoint_dir=f"{OUTPUT_DIR}/checkpoints/latest"save_load.load_checkpoint(
checkpoint_dir,
model, # Your modeloptimizer# Your optimizer
)
solver=ppsci.solver.Solver(
model=model, # Will use loaded weightsconstraint=constraint,
output_dir=OUTPUT_DIR,
optimizer=optimizer, # Will use loaded statelr_scheduler=lr_scheduler,
eval_during_train=True,
eval_freq=50,
validator=validator,
visualizer=visualizer,
)
solver.train()
得到报错AssertionError: Optimizer set error, layer_norm_1.w_0_moment1_0 should in state dict。
我看了latest.pdopt,layer_norm是从21开始的,layer_norm_21.w_0_moment1_0。
请帮我分析一下为啥优化器的数据对不上,谢谢
其他补充信息 Additional Supplementary Information
No response
The text was updated successfully, but these errors were encountered:
bug 描述 bug description
我在aistudio上跑通了那个Lorenz例子,想试下断点继续训练。我跑了10个epoch,按了停止退出codelab。然后重新进入codelab,安装paddlescience,再运行训练之前的代码。这次想用save_load把model和optimizer读出来,再尝试初始化。运行以下代码
得到报错AssertionError: Optimizer set error, layer_norm_1.w_0_moment1_0 should in state dict。
我看了latest.pdopt,layer_norm是从21开始的,layer_norm_21.w_0_moment1_0。
请帮我分析一下为啥优化器的数据对不上,谢谢
其他补充信息 Additional Supplementary Information
No response
The text was updated successfully, but these errors were encountered: