File tree 6 files changed +44
-5
lines changed
6 files changed +44
-5
lines changed Original file line number Diff line number Diff line change @@ -158,3 +158,7 @@ cython_debug/
158
158
# and can be added to the global gitignore or merged into this file. For a more nuclear
159
159
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
160
160
# .idea/
161
+
162
+ * .onnx
163
+ * .textproto
164
+ * .pb
Original file line number Diff line number Diff line change @@ -14,6 +14,12 @@ pip install --upgrade model-explorer-onnx
14
14
15
15
``` bash
16
16
model-explorer --extensions=model_explorer_onnx
17
+
18
+ # Or as a shortcut
19
+ onnxvis
20
+
21
+ # Supply model path
22
+ onnxvis model.onnx
17
23
```
18
24
19
25
## Screenshots
@@ -29,4 +35,3 @@ model-explorer --extensions=model_explorer_onnx
29
35
<img width =" 1293 " alt =" image " src =" https://github.com/justinchuby/model-explorer-onnx/assets/11205048/fbf2fa05-bd29-4938-93d1-709690d9f9c6 " >
30
36
31
37
<img width =" 1301 " alt =" image " src =" https://github.com/justinchuby/model-explorer-onnx/assets/11205048/a68f7ecd-1fa1-4eac-9e1f-8e9a5bbf9fe3 " >
32
-
Original file line number Diff line number Diff line change @@ -9,10 +9,10 @@ description = "Adapter for ai-edge-model-explorer to support ONNX models"
9
9
authors = [{
name =
" Justin Chu" ,
email =
" [email protected] " }]
10
10
readme = " README.md"
11
11
requires-python = " >=3.8"
12
- license = { file = " LICENSE" }
12
+ license = {text = " MIT License" }
13
+ keywords = [" onnx" , " model-explorer" , " visualization" ]
13
14
classifiers = [
14
- " Development Status :: 3 - Alpha" ,
15
- " Environment :: Console" ,
15
+ " Development Status :: 4 - Beta" ,
16
16
" Intended Audience :: Developers" ,
17
17
" Operating System :: POSIX" ,
18
18
" Operating System :: MacOS :: MacOS X" ,
@@ -33,5 +33,8 @@ dependencies = [
33
33
" ml_dtypes" ,
34
34
]
35
35
36
+ [project .scripts ]
37
+ onnxvis = " model_explorer_onnx.bin.onnxvis:main"
38
+
36
39
[project .urls ]
37
40
Repository = " https://github.com/justinchuby/model-explorer-onnx"
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env python
2
+ """A shortcut to run model explorer with ONNX extension."""
3
+
4
+ import subprocess
5
+ import sys
6
+
7
+
8
+ def main ():
9
+ # Run model explorer
10
+ subprocess .run (
11
+ [
12
+ "model-explorer" ,
13
+ "--extensions" ,
14
+ "model_explorer_onnx" ,
15
+ * sys .argv [1 :],
16
+ ]
17
+ )
18
+
19
+
20
+ if __name__ == "__main__" :
21
+ main ()
Original file line number Diff line number Diff line change @@ -482,10 +482,16 @@ def convert(
482
482
if opset_version is None :
483
483
opset_version = _DEFAULT_OPSET_VERSION
484
484
# TODO: Better support subgraphs in nodes
485
+ if model .graph .name is None :
486
+ model .graph .name = "<main>"
487
+ logger .warning (
488
+ "Main graph of ONNX file '%s' does not have a name. Set name to '<main>'" ,
489
+ model_path ,
490
+ )
485
491
main_graph = create_graph (
486
492
model .graph , all_function_ids , opset_version = opset_version
487
493
)
488
- assert main_graph is not None
494
+ assert main_graph is not None , "Bug: Main graph should not be None"
489
495
graphs .append (main_graph )
490
496
491
497
for function in model .functions .values ():
You can’t perform that action at this time.
0 commit comments