-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[tools/onnx-subgraph] support arbitrary input shape for onnx #14757
Conversation
1. fixed input shape as default value 2. user can set the input shape dynamically with guide ONE-DCO-1.0-Signed-off-by: Youxin Chen <yx113.chen@samsung.com>
@@ -30,7 +30,7 @@ class ModelInference: | |||
Description: | |||
Subgraphsiostxt_path is a txt file that describes the structure of the model graph and | |||
is used to get input/output node names.The model_path contains paths to multiple onnx files. | |||
The load_sessions function will sort the onnx models in the model_path according to the | |||
The load_sessions function will sort the onnx models in the model_path according to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plz split this to another PR. this change is not related to your commit message.
f"Enter new shape for input '{input_name}' (comma-separated integers), or press Enter to use default: " | ||
) | ||
custom_dtype_str = input( | ||
f"Enter data type for input '{input_name}' ('f' for float32, 'i' for int64), or press Enter to use default: " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be nice if you coult split lines so that it comes in 100 cols.
dtype = dtype_map.get(custom_dtype_str.strip(), None) | ||
if dtype is None: | ||
print("Invalid data type, please enter 'f' or 'i'.") | ||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q) if dtype
is invalid contunue
seems to skip input_name
input. is it OK with it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, thank you for suggestion, I add dtype default setting for exception case, please check
update code as review, split too long lines, and add dtype default setting for exception case
fix format checking issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
related issue: #14534
historical full changes PR: #14613
ONE-DCO-1.0-Signed-off-by: Youxin Chen yx113.chen@samsung.com