Node input 'X' is not a graph input, initializer, or output of a previous node. #2324
Unanswered
Onikage3x2
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
Today, while attempting to use a previously converted Keras model (.h5) to ONNX, specifically a DDRNet 23 Slim model, I encountered this error message. It appears that some inputs were marked as optional, leading to the following issue. Is there a way to set default values for these inputs or designate them as non-optional? I might be on the wrong path with this approach, so any assistance would be greatly appreciated.
Here's the full error message:
onnxruntime.capi.onnxruntime_pybind11_state.InvalidArgument: [ONNXRuntimeError] : 2 : INVALID_ARGUMENT : Invalid model. Node input 'model_1/add_29/add:0' is not a graph input, initializer, or output of a previous node.
Additional information:
ONNX version: 1.10
The Keras model was created with TensorFlow 2.5.
Edit:
Here is some more context.
The error comes after a successfull check:
onnx.checker.check_model(onnx_model)
In line:
session = onnxruntime.InferenceSession(model_path, providers=['CUDAExecutionProvider', 'CPUExecutionProvider'])
The input 'model_1/add_29/add:0' not a node, it's a connection.
![Screenshot 2024-04-18 134858](https://private-user-images.githubusercontent.com/20630594/323589282-b98b8f7b-7482-4a67-8c2b-fa64439ac8a9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE3MTA1NTYsIm5iZiI6MTcyMTcxMDI1NiwicGF0aCI6Ii8yMDYzMDU5NC8zMjM1ODkyODItYjk4YjhmN2ItNzQ4Mi00YTY3LThjMmItZmE2NDQzOWFjOGE5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzIzVDA0NTA1NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTM5NGI5NTNkNDIxMDY2Y2Q4MDE3MzYwNWU0NGVhOGMyYjdkOGVjNjIwMTgzZmUzNjE4NzJlNWEzMjI5Yzk0NzcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.iPEAGQJmuOBnaBHiknxDF7RxaHk_46UaRB-HvGELZiw)
Beta Was this translation helpful? Give feedback.
All reactions