Skip to content

Fixing ONNX error - #11

Merged
acolombier merged 1 commit into
mixxxdj:mainfrom
writer-in-fancy-pants:patch-1
Jan 4, 2026
Merged

Fixing ONNX error#11
acolombier merged 1 commit into
mixxxdj:mainfrom
writer-in-fancy-pants:patch-1

Conversation

@writer-in-fancy-pants

Copy link
Copy Markdown

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">.

There's also an issue with running the conversion with newer onnx versions >1.19

Error during ONNX export: STFT does not currently support complex types  [Caused by the value '636 defined in (%636 : Float(*, *, strides=[351232, 1], requires_grad=0, device=cpu) = onnx::Reshape[allowzero=0](%626, %635), scope: demucs.htdemucs.HTDemucs:: # <env>/lib/python3.10/site-packages/torch/functional.py:659:0
)' (type 'Tensor') in the TorchScript graph. The containing node has kind 'onnx::Reshape'.] 

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">.```

@acolombier acolombier left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@acolombier
acolombier merged commit d788c1a into mixxxdj:main Jan 4, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants