Skip to content

fix: lcurve header wrong when no validation data #3774

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

Merged
merged 1 commit into from
May 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions deepmd/pt/train/training.py
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,7 @@
learning_rate=cur_lr,
)
)
if valid_results is not None and valid_results[_key]:
if valid_results[_key]:

Check warning on line 912 in deepmd/pt/train/training.py

View check run for this annotation

Codecov / codecov/patch

deepmd/pt/train/training.py#L912

Added line #L912 was not covered by tests
log.info(
format_training_message_per_task(
batch=_step_id,
Expand Down Expand Up @@ -1118,7 +1118,7 @@
print_str = ""
print_str += "# %5s" % "step"
if not self.multi_task:
if valid_results is not None:
if valid_results:
prop_fmt = " %11s %11s"
for k in train_keys:
print_str += prop_fmt % (k + "_val", k + "_trn")
Expand All @@ -1128,7 +1128,7 @@
print_str += prop_fmt % (k + "_trn")
else:
for model_key in self.model_keys:
if valid_results[model_key] is not None:
if valid_results[model_key]:

Check warning on line 1131 in deepmd/pt/train/training.py

View check run for this annotation

Codecov / codecov/patch

deepmd/pt/train/training.py#L1131

Added line #L1131 was not covered by tests
prop_fmt = " %11s %11s"
for k in sorted(train_results[model_key].keys()):
print_str += prop_fmt % (
Expand Down