From ef61957b3ba6024d91d355a78703c8b4c9f867d9 Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Mon, 23 Oct 2023 17:52:36 -0400 Subject: [PATCH] fix slicing error --- deepmd/entrypoints/convert.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deepmd/entrypoints/convert.py b/deepmd/entrypoints/convert.py index 0511950b73..ed125f04c7 100644 --- a/deepmd/entrypoints/convert.py +++ b/deepmd/entrypoints/convert.py @@ -18,8 +18,8 @@ def convert( output_model: str, **kwargs, ): - if output_model[:-6] == ".pbtxt": - if input_model[:-6] != ".pbtxt": + if output_model[-6:] == ".pbtxt": + if input_model[-6:] != ".pbtxt": convert_pb_to_pbtxt(input_model, output_model) else: raise RuntimeError("input model is already pbtx")