From c49533eadb4502a173f7b5a79aeccfca3c216811 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Tue, 22 Mar 2022 21:11:11 -0400 Subject: [PATCH] support `dp convert-from 1.1` (#1587) * support `dp convert-from 1.1` #1583 It looks like there's no breaking changes between v1.1 and v1.2. * update doc --- deepmd/entrypoints/convert.py | 3 ++- deepmd/entrypoints/main.py | 2 +- doc/troubleshooting/model-compatability.md | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/deepmd/entrypoints/convert.py b/deepmd/entrypoints/convert.py index 3f277c5134..782bb89241 100644 --- a/deepmd/entrypoints/convert.py +++ b/deepmd/entrypoints/convert.py @@ -7,7 +7,8 @@ def convert( output_model: str, **kwargs, ): - if FROM == '1.2': + if FROM in ['1.1', '1.2']: + # no difference between 1.1 and 1.2 convert_12_to_21(input_model, output_model) elif FROM == '1.3': convert_13_to_21(input_model, output_model) diff --git a/deepmd/entrypoints/main.py b/deepmd/entrypoints/main.py index 3a9d3991ce..043e6523df 100644 --- a/deepmd/entrypoints/main.py +++ b/deepmd/entrypoints/main.py @@ -392,7 +392,7 @@ def parse_args(args: Optional[List[str]] = None): parser_transform.add_argument( 'FROM', type = str, - choices = ['1.2', '1.3', '2.0'], + choices = ['1.1', '1.2', '1.3', '2.0'], help="The original model compatibility", ) parser_transform.add_argument( diff --git a/doc/troubleshooting/model-compatability.md b/doc/troubleshooting/model-compatability.md index 2b7e46a4b7..5c0aa11889 100644 --- a/doc/troubleshooting/model-compatability.md +++ b/doc/troubleshooting/model-compatability.md @@ -8,7 +8,7 @@ One can execute `dp convert-from` to convert an old model to a new one. | Model version | v0.12 | v1.0 | v1.1 | v1.2 | v1.3 | v2.0 | v2.1 | |:-:|:-----------:|:----------:|:----------:|:----------:|:----------:|:----------:|:----------:| -| Compatibility | 😢 | 😢 | 😢 | 😊 | 😊 | 😄 | 😄 | +| Compatibility | 😢 | 😢 | 😊 | 😊 | 😊 | 😄 | 😄 | **Legend**: - 😄: The model is compatible with the DeePMD-kit package.