Skip to content

Commit

Permalink
docs: improve error message for inconsistent type maps
Browse files Browse the repository at this point in the history
Fix deepmodeling#4034.

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
  • Loading branch information
njzjz committed Aug 21, 2024
1 parent 63e4a25 commit ceb44da
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion deepmd/utils/data_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,11 @@ def _check_type_map_consistency(self, type_map_list):
min_len = min([len(ii), len(ret)])
for idx in range(min_len):
if ii[idx] != ret[idx]:
raise RuntimeError(f"inconsistent type map: {ret!s} {ii!s}")
raise RuntimeError(
f"Inconsistent type map: {ret!s} {ii!s} in different data systems. "
"If you didn't set model/type_map, please set it, "
"since the type map of the model cannot be decided by data."
)
if len(ii) > len(ret):
ret = ii
return ret
Expand Down

0 comments on commit ceb44da

Please sign in to comment.