Skip to content

Add flag to specifically handle ckpt with old naming scheme

Jay Chan requested to merge jay_fix_old_ckpt_compatible into dev

When we set variable_with_prefix : False, it will convert variables to new naming scheme for the codes to run, and in the end convert variables back to the old naming scheme for the outputs. So if we want to keep the variables with the new naming scheme for the output pyg, we need to either:

  • set variable_with_prefix : True for the case where input pyg + yaml + checkpoint are already with new naming scheme
  • set variable_with_prefix : True + add_variable_name_prefix: True for the case where yaml + checkpoints are already with new naming scheme but input pyg are not

If the checkpoint file is with old naming scheme, the only way to handle it is to set variable_with_prefix : False to enable full backward compatibility (convert everything), but this will convert back to the old naming scheme in the end for the pyg, which may not be what we want, so in this MR, I add another flag add_variable_name_prefix_in_ckpt to handle this case. And in this case, we can do:

  • variable_with_prefix : True + add_variable_name_prefix_in_ckpt: True for the case where pyg and yaml are with the new naming scheme but checkpoint is not

To avoid confusion, add_variable_name_prefix flag is renamed to add_variable_name_prefix_in_pyg.

All the example yaml files in examples/Variable_Name_Prefix have been updated accordingly.

Edited by Jay Chan

Merge request reports

Loading