Skip to content
Snippets Groups Projects
Commit 293dda2d authored by Iryna de Albuquerque Silva's avatar Iryna de Albuquerque Silva Committed by Iryna de Albuquerque Silva
Browse files

Corrected error in the writing of trainable parameters path in JSON file.

parent f4437b4d
No related branches found
No related tags found
2 merge requests!284Add support for non-defined inputs and outputs of nodes in show_graphview.py.,!243Correct logic for Node's parents/children association with inputs/outputs in aidge_core/show_graphview.py.
This commit is part of merge request !243. Comments created here will be created in the context of that merge request.
...@@ -129,7 +129,7 @@ def _create_dict(ordered_nodes : list[aidge_core.Node], write_trainable_params_e ...@@ -129,7 +129,7 @@ def _create_dict(ordered_nodes : list[aidge_core.Node], write_trainable_params_e
if params_file_format=='npz': if params_file_format=='npz':
np.savez_compressed(Path(path_trainable_params, node.name()), **{node.name() : node.get_operator().get_output(0)}) 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': elif params_file_format=='json':
tensor = np.array(node.get_operator().get_output(0)) 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 ...@@ -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: with open(Path(path_trainable_params, node.name() + '.json'), 'w') as fp:
json.dump(tensor_dict, fp, indent=4) 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: else:
raise Exception("File format to write trainable parameters not recognized.") raise Exception("File format to write trainable parameters not recognized.")
......
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