-
Notifications
You must be signed in to change notification settings - Fork 488
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/sg 000 fix import of onnx graphsurgeon (#1359)
* Update readme * Fix small bug in __repr__ implementation of KeypointsImageToTensor * Test * Test * Test * Test * Test * Test * Make graphsurgeon an optional * Make graphsurgeon an optional * Properly handle imports of optional packages * Added empty __init__.py files * Do imports of gs inside the export call * Do imports of gs inside the export call * Fix DEKR's missing HasPredict interface * Update notebook & example doc to reflect changes in imports & function names * Update readme * Put back images * Install onnx_graphsurgeon in CI * Install onnx_graphsurgeon in CI * Fix version of ONNX-GS installed in CI and installed on-demand * Fix arange_cpu not implemented for Half * Fix arange_cpu not implemented for Half * Fix graph merging for old pytorch (1.12) that crashed because of nodes with duplicate names
- Loading branch information
Showing
19 changed files
with
111 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+0 Bytes
(100%)
documentation/source/models_export_files/models_export_18_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+0 Bytes
(100%)
documentation/source/models_export_files/models_export_24_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+0 Bytes
(100%)
documentation/source/models_export_files/models_export_26_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+336 Bytes
(100%)
documentation/source/models_export_files/models_export_28_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-293 Bytes
(100%)
documentation/source/models_export_files/models_export_30_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from .conversion_enums import ExportTargetBackend, ExportQuantizationMode, DetectionOutputFormatMode | ||
|
||
__all__ = ["ExportQuantizationMode", "DetectionOutputFormatMode", "ExportTargetBackend"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
def import_onnx_graphsurgeon_or_fail_with_instructions(): | ||
try: | ||
import onnx_graphsurgeon as gs | ||
except ImportError: | ||
raise ImportError( | ||
"onnx-graphsurgeon is required to use export API. " | ||
"Please install it with pip install onnx_graphsurgeon==0.3.27 --extra-index-url https://pypi.ngc.nvidia.com" | ||
) | ||
return gs | ||
|
||
|
||
def import_onnx_graphsurgeon_or_install(): | ||
try: | ||
import onnx_graphsurgeon as gs | ||
|
||
return gs | ||
except ImportError: | ||
import pip | ||
|
||
pip.main(["install", "onnx_graphsurgeon==0.3.27", "--extra-index-url", "https://pypi.ngc.nvidia.com"]) | ||
|
||
return import_onnx_graphsurgeon_or_fail_with_instructions() |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.