gmalivenko / onnx2keras

Convert ONNX model graph to Keras model format.
MIT License
193 stars 115 forks source link

'/Reshape_output_0/' is not a valid root scope name. #169

Open kovarole2 opened 1 year ago

kovarole2 commented 1 year ago

Trying to load and use onnx exported from pytorch - (1, 3, 28, 28).

onnx_model = onnx.load('data/export-torch.onnx') k_model = onnx_to_keras(onnx_model, ['actual_input'])

DEBUG:onnx2keras:... DEBUG:onnx2keras:Check if all inputs are available: DEBUG:onnx2keras:Check input 0 (name actual_input). DEBUG:onnx2keras:Check input 1 (name /Constant_output_0). DEBUG:onnx2keras:... found all, continue DEBUG:onnx2keras:reshape:The second argument is numpy array. DEBUG:onnx2keras:reshape:The first argument is Keras/tf layer. Apply keras.Reshape. DEBUG:onnx2keras:reshape:Target shape : DEBUG:onnx2keras:reshape:[784] .... --> 191 layers[node_name] = reshape(input_0) .... ValueError: '/Reshape_output0/' is not a valid root scope name. A root scope name has to match the following pattern: ^[A-Za-z0-9.][A-Za-z0-9.\/>-]*$

kovarole2 commented 1 year ago

node { input: "/Reshape_output_0" input: "linear1.weight" input: "linear1.bias" output: "/linear1/Gemm_output_0" name: "/linear1/Gemm" op_type: "Gemm" attribute { name: "alpha" type: FLOAT f: 1 } attribute { name: "beta" type: FLOAT f: 1 } attribute { name: "transB" type: INT i: 1 } }

boutiche commented 4 months ago

Hello, I have the same issue, did you find any solution for this?

Thank you