Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

save checkpoint files with step and keep recent files #1031

Merged
merged 1 commit into from
Aug 25, 2021

Conversation

njzjz
Copy link
Member

@njzjz njzjz commented Aug 25, 2021

This commit saves checkpoint to save_ckpt-step (e.g. model.ckpt-100) instead of save_ckpt (e.g. model.ckpt), and keeps 5 recent checkpoint files (this is a default value of tf.Saver). Such thing is conducted by tf.Saver. To not break any behaviors, a symlink will then be made from model.ckpt-100 to model.ckpt. (Usually such thing should be controlled by checkpoint file, but deepmd-kit doesn't read this file.)
This can fix #1023, as (1) we made symlink after a checkpoint has been already saved; (2) if something is still wrong, one can use a previous checkpoint instead.

This commit saves checkpoint to `save_ckpt-step` (e.g. `model.ckpt-100`) instead of `save_ckpt` (e.g. `model.ckpt`), and keeps 5 recent checkpoint files (this is a default value of `tf.Saver`). Such thing is conducted by `tf.Saver`.  To not break any behaviors, a symlink will then be made from  `model.ckpt-100` to `model.ckpt`. (Usually such thing should be controlled by `checkpoint` file, but deepmd-kit doesn't read this file.)
This can fix deepmodeling#1023, as (1) we made symlink after a checkpoint has been already saved; (2) if something is still wrong, one can use a previous checkpoint instead.
@codecov-commenter
Copy link

codecov-commenter commented Aug 25, 2021

Codecov Report

Merging #1031 (568b2fc) into devel (fd1f371) will decrease coverage by 10.72%.
The diff coverage is n/a.

❗ Current head 568b2fc differs from pull request most recent head 71b84f5. Consider uploading reports for the commit 71b84f5 to get more accurate results
Impacted file tree graph

@@             Coverage Diff             @@
##            devel    #1031       +/-   ##
===========================================
- Coverage   75.01%   64.28%   -10.73%     
===========================================
  Files          86        5       -81     
  Lines        6924       14     -6910     
===========================================
- Hits         5194        9     -5185     
+ Misses       1730        5     -1725     
Impacted Files Coverage Δ
deepmd/infer/deep_dipole.py
deepmd/__init__.py
deepmd/fit/polar.py
deepmd/descriptor/se_t.py
deepmd/utils/data.py
deepmd/cluster/local.py
deepmd/entrypoints/doc.py
deepmd/fit/dipole.py
source/op/_prod_virial_se_r_grad.py
deepmd/entrypoints/main.py
... and 70 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fd1f371...71b84f5. Read the comment docs.

@amcadmus amcadmus merged commit 96bc025 into deepmodeling:devel Aug 25, 2021
gzq942560379 pushed a commit to HPC-AI-Team/deepmd-kit that referenced this pull request Sep 2, 2021
)

This commit saves checkpoint to `save_ckpt-step` (e.g. `model.ckpt-100`) instead of `save_ckpt` (e.g. `model.ckpt`), and keeps 5 recent checkpoint files (this is a default value of `tf.Saver`). Such thing is conducted by `tf.Saver`.  To not break any behaviors, a symlink will then be made from  `model.ckpt-100` to `model.ckpt`. (Usually such thing should be controlled by `checkpoint` file, but deepmd-kit doesn't read this file.)
This can fix deepmodeling#1023, as (1) we made symlink after a checkpoint has been already saved; (2) if something is still wrong, one can use a previous checkpoint instead.
njzjz added a commit to njzjz/deepmd-kit that referenced this pull request Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants