Skip to content

Commit c79be86

Browse files
Fixing ONNX error
Updating path variable to a string to avoid the following error ```Error during ONNX export: Function torch.onnx.utils.export() parameter f="PosixPath('htdemucs.onnx')" violates type hint typing.Union[str, _io.BytesIO], as <protocol "pathlib.PosixPath"> "PosixPath('htdemucs.onnx')" not str or <class "_io.BytesIO">.```
1 parent 83a2217 commit c79be86

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

scripts/convert-pth-to-onnx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
torch.onnx.export(
4949
core_model,
5050
dummy_input,
51-
onnx_file_path,
51+
str(onnx_file_path),
5252
export_params=True,
5353
opset_version=17,
5454
do_constant_folding=True,

0 commit comments

Comments
 (0)