From 293dda2d7f91bf9467a8c51eef3f61fc7dd2e183 Mon Sep 17 00:00:00 2001
From: idealbuq <iryna.dealbuquerquesilva@cea.fr>
Date: Mon, 4 Nov 2024 13:56:59 +0000
Subject: [PATCH] Corrected error in the writing of trainable parameters path
 in JSON file.

---
 aidge_core/show_graphview.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/aidge_core/show_graphview.py b/aidge_core/show_graphview.py
index 633298f10..23d4b5f37 100644
--- a/aidge_core/show_graphview.py
+++ b/aidge_core/show_graphview.py
@@ -129,7 +129,7 @@ def _create_dict(ordered_nodes : list[aidge_core.Node], write_trainable_params_e
 
                     if params_file_format=='npz':
                         np.savez_compressed(Path(path_trainable_params, node.name()), **{node.name() : node.get_operator().get_output(0)})
-                        node_dict['tensor_data'] = Path(path_trainable_params, node.name() + '.npz')
+                        node_dict['tensor_data'] = str(Path(path_trainable_params, node.name() + '.npz'))
 
                     elif params_file_format=='json':
                         tensor = np.array(node.get_operator().get_output(0))
@@ -145,7 +145,7 @@ def _create_dict(ordered_nodes : list[aidge_core.Node], write_trainable_params_e
                         with open(Path(path_trainable_params, node.name() + '.json'), 'w') as fp:
                             json.dump(tensor_dict, fp, indent=4)
 
-                        node_dict['tensor_data'] = Path(path_trainable_params, node.name() + '.json')
+                        node_dict['tensor_data'] = str(Path(path_trainable_params, node.name() + '.json'))
 
                     else:
                         raise Exception("File format to write trainable parameters not recognized.")
-- 
GitLab