deepC icon indicating copy to clipboard operation
deepC copied to clipboard

Node id's including slashes cause "no such file or directory" error

Open robinvanemden opened this issue 4 years ago • 1 comments

When converting the included model with onnx-cpp it throws the following error:

reading onnx model from file  optimized.onnx
Model info:
  ir_vesion :  4
  doc       :
INFO (ONNX): writing model parameter const_fold_opt__17 to dir savedmodel/.
INFO (ONNX): writing model parameter StatefulPartitionedCall/sequential_1/dense_2/MatMul/ReadVariableOp:0 to dir savedmodel/.
Traceback (most recent call last):
  File "/home/robin/.local/bin/onnx-cpp", line 11, in <module>
    sys.exit(main())
  File "/home/robin/.local/lib/python3.6/site-packages/deepC/compiler/onnx2cpp.py", line 65, in main
    dcGraph = parser.main(onnx_file, bundle_dir, optimize=False, checker=False)
  File "/home/robin/.local/lib/python3.6/site-packages/deepC/compiler/read_onnx.py", line 486, in main
    self.addParams(param);
  File "/home/robin/.local/lib/python3.6/site-packages/deepC/compiler/read_onnx.py", line 194, in addParams
    self.writeParamsToFile(param.name, param_vals);
  File "/home/robin/.local/lib/python3.6/site-packages/deepC/compiler/read_onnx.py", line 56, in writeParamsToFile
    with open(paramFile, "w") as fp:
FileNotFoundError: [Errno 2] No such file or directory: 'savedmodel/StatefulPartitionedCall/sequential_1/dense_2/MatMul/ReadVariableOp:0'

I presume this is probably caused by the slashes in the node id's of the model?

slashes.zip

robinvanemden avatar Jul 03 '20 16:07 robinvanemden

i am also encountering this issue. do you have any way to get around this issue?

busFred avatar Jan 16 '23 21:01 busFred