From bb9706e7d179fbf30a5eedd0b0008d1ec470f768 Mon Sep 17 00:00:00 2001 From: Luis Filipe Araujo de Souza <58831491+Doquey@users.noreply.github.com> Date: Fri, 29 Sep 2023 14:23:05 -0300 Subject: [PATCH] ONNX export Path to str() (#12177) * 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> --- export.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/export.py b/export.py index 92d42472dfc4..71e4eb94d1c4 100644 --- a/export.py +++ b/export.py @@ -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: