diff --git a/deepmd/descriptor/se_atten.py b/deepmd/descriptor/se_atten.py index 8db4502fa8..2a9b70fdfb 100644 --- a/deepmd/descriptor/se_atten.py +++ b/deepmd/descriptor/se_atten.py @@ -429,11 +429,9 @@ def _get_two_side_embedding_net_variable(self, graph_def, varialbe_name, suffix) for i in range(1, self.layer_size + 1): target = get_pattern_nodes_from_graph_def( graph_def, - f"filter_type_all{suffix}/{varialbe_name}_{i}{suffix}_two_side_ebd", + f"filter_type_all{suffix}/{varialbe_name}_{i}_two_side_ebd", ) - node = target[ - f"filter_type_all{suffix}/{varialbe_name}_{i}{suffix}_two_side_ebd" - ] + node = target[f"filter_type_all{suffix}/{varialbe_name}_{i}_two_side_ebd"] ret["layer_" + str(i)] = node return ret diff --git a/deepmd/utils/tabulate.py b/deepmd/utils/tabulate.py index 6895fcbf13..d30d8bcf38 100644 --- a/deepmd/utils/tabulate.py +++ b/deepmd/utils/tabulate.py @@ -420,7 +420,7 @@ def _get_bias(self): bias["layer_" + str(layer)] = [] if isinstance(self.descrpt, deepmd.descriptor.DescrptSeAtten): node = self.embedding_net_nodes[ - f"filter_type_all{self.suffix}/bias_{layer}{self.suffix}" + f"filter_type_all{self.suffix}/bias_{layer}" ] bias["layer_" + str(layer)].append(tf.make_ndarray(node)) elif isinstance(self.descrpt, deepmd.descriptor.DescrptSeA): @@ -484,7 +484,7 @@ def _get_matrix(self): matrix["layer_" + str(layer)] = [] if isinstance(self.descrpt, deepmd.descriptor.DescrptSeAtten): node = self.embedding_net_nodes[ - f"filter_type_all{self.suffix}/matrix_{layer}{self.suffix}" + f"filter_type_all{self.suffix}/matrix_{layer}" ] matrix["layer_" + str(layer)].append(tf.make_ndarray(node)) elif isinstance(self.descrpt, deepmd.descriptor.DescrptSeA):