Skip to content
Snippets Groups Projects
Commit f54ee318 authored by Grégoire Kubler's avatar Grégoire Kubler Committed by Cyril Moineau
Browse files

fix : inverted conditions on onnx2aidge_name

parent e6fdc573
No related branches found
No related tags found
2 merge requests!390.2.1,!33feat/script_compare_layers_aidge_onnx
Pipeline #43891 passed
...@@ -18,6 +18,7 @@ _MAP_NP_ONNX_TYPE = { ...@@ -18,6 +18,7 @@ _MAP_NP_ONNX_TYPE = {
} }
_MAP_ONNX_NP_TYPE = {v: k for k, v in _MAP_NP_ONNX_TYPE.items()} _MAP_ONNX_NP_TYPE = {v: k for k, v in _MAP_NP_ONNX_TYPE.items()}
def onnx_to_aidge_model_names(model: onnx.ModelProto): def onnx_to_aidge_model_names(model: onnx.ModelProto):
""" """
Change the name of each node of the model from onnx convention to aidge's one Change the name of each node of the model from onnx convention to aidge's one
...@@ -63,6 +64,5 @@ def onnx_to_aidge_name(name: str) -> str: ...@@ -63,6 +64,5 @@ def onnx_to_aidge_name(name: str) -> str:
Translates onnx node naming convention to aidge naming convention Translates onnx node naming convention to aidge naming convention
""" """
name = name.replace("/", "_").replace(".", "_") name = name.replace("/", "_").replace(".", "_")
name = name if len(name) > 0 and name[0].isdigit() else "data_" + name name = name if (len(name) == 0 or not name[0].isdigit()) else "data_" + name
return name return name
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment