Skip to content

Commit

Permalink
ONNX export Path to str() (#12177)
Browse files Browse the repository at this point in the history
* Update export.py

Signed-off-by: Luis Filipe Araujo de Souza <58831491+Doquey@users.noreply.github.com>

* Update export.py

Signed-off-by: Luis Filipe Araujo de Souza <58831491+Doquey@users.noreply.github.com>

* Update export.py

Transformed the f variable into a string on the export onnx. This bug was making it impossible to export any models in .onnx, since it was making the typehint not accept the users input as it is specified in the functions documentation

Signed-off-by: Luis Filipe Araujo de Souza <58831491+Doquey@users.noreply.github.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Signed-off-by: Luis Filipe Araujo de Souza <58831491+Doquey@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
Doquey and pre-commit-ci[bot] authored Sep 29, 2023
1 parent 6262c7f commit bb9706e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion export.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def export_onnx(model, im, file, opset, dynamic, simplify, prefix=colorstr('ONNX
import onnx

LOGGER.info(f'\n{prefix} starting export with onnx {onnx.__version__}...')
f = file.with_suffix('.onnx')
f = str(file.with_suffix('.onnx'))

output_names = ['output0', 'output1'] if isinstance(model, SegmentationModel) else ['output0']
if dynamic:
Expand Down

0 comments on commit bb9706e

Please sign in to comment.