Skip to content

Commit

Permalink
producer, opset
Browse files Browse the repository at this point in the history
  • Loading branch information
PINTO0309 committed May 27, 2022
1 parent c8f2f3e commit 0a55d05
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ structure_check(
│ Model Size │ 37.2MiB │
└────────────────────────┴────────────┘
INFO: file: deqflow_b_things_opset12_192x320.onnx
INFO: producer: pytorch 1.11.0
INFO: opset: 12
INFO: input_name.1: input1 shape: [1, 3, 192, 320] dtype: float32
INFO: input_name.2: input2 shape: [1, 3, 192, 320] dtype: float32
INFO: output_name.1: flow_up shape: [1, 2, 192, 320] dtype: float32
Expand Down
2 changes: 1 addition & 1 deletion ssc4onnx/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from ssc4onnx.onnx_structure_check import structure_check, main

__version__ = '1.0.1'
__version__ = '1.0.2'
16 changes: 16 additions & 0 deletions ssc4onnx/onnx_structure_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,22 @@ def structure_check(
f'{Color.GREEN}INFO:{Color.RESET} '+ \
f'{Color.BLUE}file:{Color.RESET} {input_onnx_file_path}'
)
producer_name = ''
if hasattr(onnx_graph, 'producer_name'):
producer_name = onnx_graph.producer_name
producer_version = ''
if hasattr(onnx_graph, 'producer_version'):
producer_version = onnx_graph.producer_version
if producer_name:
print(\
f'{Color.GREEN}INFO:{Color.RESET} '+ \
f'{Color.BLUE}producer:{Color.RESET} {producer_name} {producer_version}'
)
if hasattr(onnx_graph, 'opset_import') and len(onnx_graph.opset_import) > 0:
print(\
f'{Color.GREEN}INFO:{Color.RESET} '+ \
f'{Color.BLUE}opset:{Color.RESET} {onnx_graph.opset_import[0].version}'
)
for idx, ort_input_name, ort_input_shape, onnx_input_type in zip(range(1, len(ort_input_names)+1), ort_input_names, ort_input_shapes, onnx_input_types):
print(\
f'{Color.GREEN}INFO:{Color.RESET} '+ \
Expand Down

0 comments on commit 0a55d05

Please sign in to comment.