Skip to content

Commit

Permalink
still need to do intersection
Browse files Browse the repository at this point in the history
Signed-off-by: Jinzhe Zeng <[email protected]>
  • Loading branch information
njzjz committed Mar 1, 2024
1 parent a09b69d commit 1fd9a7b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions deepmd/tf/entrypoints/freeze.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,13 +365,14 @@ def freeze_graph(
"fitting_attr/aparam_nall",
"spin_attr/ntypes_spin",
]
different_set = set(output_node) - set(input_node) - set(optional_node)
different_set = set(output_node) - set(input_node)
if different_set:
log.warning(
"The following nodes are not in the graph: %s. "
"Skip freezeing these nodes. You may be freezing "
"a checkpoint generated by an old version." % different_set
)
if different_set - set(optional_node):
log.warning(
"The following nodes are not in the graph: %s. "
"Skip freezeing these nodes. You may be freezing "
"a checkpoint generated by an old version." % different_set
)
# use intersection as output list
output_node = list(set(output_node) & set(input_node))
log.info(f"The following nodes will be frozen: {output_node}")
Expand Down

0 comments on commit 1fd9a7b

Please sign in to comment.