diff --git a/deepmd/dpmodel/fitting/property_fitting.py b/deepmd/dpmodel/fitting/property_fitting.py index 7845833ab9..2906bed62c 100644 --- a/deepmd/dpmodel/fitting/property_fitting.py +++ b/deepmd/dpmodel/fitting/property_fitting.py @@ -123,7 +123,7 @@ def __init__( @classmethod def deserialize(cls, data: dict) -> "PropertyFittingNet": data = data.copy() - check_version_compatibility(data.pop("@version"), 3, 1) + check_version_compatibility(data.pop("@version"), 4, 1) data.pop("dim_out") data.pop("var_name") data.pop("tot_ener_zero") @@ -145,5 +145,6 @@ def serialize(self) -> dict: "property_name": self.property_name, "property_dim": self.property_dim, } + dd["@version"] = 4 return dd diff --git a/deepmd/pt/model/task/property.py b/deepmd/pt/model/task/property.py index 4c0817c175..d48751487d 100644 --- a/deepmd/pt/model/task/property.py +++ b/deepmd/pt/model/task/property.py @@ -146,7 +146,7 @@ def output_def(self) -> FittingOutputDef: @classmethod def deserialize(cls, data: dict) -> "PropertyFittingNet": data = data.copy() - check_version_compatibility(data.pop("@version", 1), 3, 1) + check_version_compatibility(data.pop("@version", 1), 4, 1) data.pop("dim_out") data.pop("var_name") obj = super().deserialize(data) @@ -163,6 +163,7 @@ def serialize(self) -> dict: "property_name": self.property_name, "property_dim": self.property_dim, } + dd["@version"] = 4 return dd