keras-onnx icon indicating copy to clipboard operation
keras-onnx copied to clipboard

Nodes in a graph must be topologically sorted, however input is not output of any previous nodes.

Open Toku11 opened this issue 5 years ago • 1 comments

When converting a custom layer with skip connection it gives an error it doesn't matter what is the layer doing even dummy layer

if model : ` def model():

i = tf.keras.layers.Input(shape=shape, name='input') x = AnyKerasLayer()(x) y = CustomLayer()(x) x = tf.keras.layers.add([x,y]) o = outputLayer()(x) returnModel(inputs=i,outputs=o,name='model_name')

`

You will get Nodes in a graph must be topologically sorted, however input 'CustomLayer/xxx2:0' of node input 'CustomLayer/xxx1:0' output: "add/add:0" name: "Add1" op_type: "Add" doc_string: "" domain: "" is not output of any previous nodes.

ONNX IR version: 0.0.7 Opset version: 12 Producer name: keras2onnx Producer version: 1.7.0 Domain: onnxmltools Model version: 0 Doc string:

Toku11 avatar Jun 03 '20 14:06 Toku11

Can you provide a real example for us to debug (you can change or simplify your original model)?

jiafatom avatar Jun 05 '20 00:06 jiafatom