JonathanFly/bark

Function torch.onnx.symbolic_helper._onnx_unsupported()

f1am3d opened this issue · 11 comments

f1am3d commented

Getting this error on the step python bark_perform.py:

Stacktrace:

Traceback (most recent call last):
  File "C:\Users\f1am3d\repos\bark\bark_perform.py", line 6, in <module>
    from bark_infinity import config
  File "C:\Users\f1am3d\repos\bark\bark_infinity\__init__.py", line 1, in <module>
    from .api import generate_audio, text_to_semantic, semantic_to_waveform, save_as_prompt
  File "C:\Users\f1am3d\repos\bark\bark_infinity\api.py", line 14, in <module>
    from .generation import get_SUNO_USE_DIRECTML
  File "C:\Users\f1am3d\repos\bark\bark_infinity\generation.py", line 7, in <module>
    from encodec import EncodecModel
  File "C:\Users\f1am3d\miniconda3\envs\pydml_torch2\lib\site-packages\encodec\__init__.py", line 12, in <module>
    from .model import EncodecModel
  File "C:\Users\f1am3d\miniconda3\envs\pydml_torch2\lib\site-packages\encodec\model.py", line 14, in <module>
    import torch
  File "C:\Users\f1am3d\miniconda3\envs\pydml_torch2\lib\site-packages\torch\__init__.py", line 1239, in <module>
    from torch import onnx as onnx
  File "C:\Users\f1am3d\miniconda3\envs\pydml_torch2\lib\site-packages\torch\onnx\__init__.py", line 12, in <module>
    from . import (  # usort:skip. Keep the order instead of sorting lexicographically
  File "C:\Users\f1am3d\miniconda3\envs\pydml_torch2\lib\site-packages\torch\onnx\symbolic_caffe2.py", line 4, in <module>
    from torch.onnx import symbolic_helper, symbolic_opset9 as opset9
  File "C:\Users\f1am3d\miniconda3\envs\pydml_torch2\lib\site-packages\torch\onnx\symbolic_helper.py", line 611, in <module>
    def _onnx_unsupported(op_name: str, value: Optional[_C.Value] = None) -> NoReturn:
  File "C:\Users\f1am3d\miniconda3\envs\pydml_torch2\lib\site-packages\beartype\_decor\decorcache.py", line 77, in beartype
    return beartype_object(obj, conf)
  File "C:\Users\f1am3d\miniconda3\envs\pydml_torch2\lib\site-packages\beartype\_decor\decorcore.py", line 98, in beartype_object
    _beartype_object_fatal(obj, conf=conf, **kwargs)
  File "C:\Users\f1am3d\miniconda3\envs\pydml_torch2\lib\site-packages\beartype\_decor\decorcore.py", line 147, in _beartype_object_fatal
    beartype_nontype(obj, **kwargs)  # type: ignore[return-value]
  File "C:\Users\f1am3d\miniconda3\envs\pydml_torch2\lib\site-packages\beartype\_decor\_decormore.py", line 178, in beartype_nontype
    return beartype_func(obj, **kwargs)  # type: ignore[return-value]
  File "C:\Users\f1am3d\miniconda3\envs\pydml_torch2\lib\site-packages\beartype\_decor\_decormore.py", line 242, in beartype_func
    func_wrapper_code = generate_code(bear_call)
  File "C:\Users\f1am3d\miniconda3\envs\pydml_torch2\lib\site-packages\beartype\_decor\wrap\wrapmain.py", line 187, in generate_code
    code_check_return = _code_check_return(bear_call)
  File "C:\Users\f1am3d\miniconda3\envs\pydml_torch2\lib\site-packages\beartype\_decor\wrap\wrapmain.py", line 669, in _code_check_return
    reraise_exception_placeholder(
  File "C:\Users\f1am3d\miniconda3\envs\pydml_torch2\lib\site-packages\beartype\_util\error\utilerror.py", line 214, in reraise_exception_placeholder
    raise exception.with_traceback(exception.__traceback__)
  File "C:\Users\f1am3d\miniconda3\envs\pydml_torch2\lib\site-packages\beartype\_decor\wrap\wrapmain.py", line 618, in _code_check_return
    ) = make_func_wrapper_code(hint_sane, bear_call.conf, cls_stack)  # type: ignore[assignment]
  File "C:\Users\f1am3d\miniconda3\envs\pydml_torch2\lib\site-packages\beartype\_util\cache\utilcachecall.py", line 259, in _callable_cached
    raise exception
  File "C:\Users\f1am3d\miniconda3\envs\pydml_torch2\lib\site-packages\beartype\_util\cache\utilcachecall.py", line 251, in _callable_cached
    return_value = args_flat_to_return_value[args_flat] = func(
  File "C:\Users\f1am3d\miniconda3\envs\pydml_torch2\lib\site-packages\beartype\_decor\wrap\_wrapcode.py", line 86, in make_func_wrapper_code
    ) = make_check_expr(hint, conf, cls_stack)
  File "C:\Users\f1am3d\miniconda3\envs\pydml_torch2\lib\site-packages\beartype\_util\cache\utilcachecall.py", line 259, in _callable_cached
    raise exception
  File "C:\Users\f1am3d\miniconda3\envs\pydml_torch2\lib\site-packages\beartype\_util\cache\utilcachecall.py", line 251, in _callable_cached
    return_value = args_flat_to_return_value[args_flat] = func(
  File "C:\Users\f1am3d\miniconda3\envs\pydml_torch2\lib\site-packages\beartype\_check\code\codemake.py", line 706, in make_check_expr
    die_if_hint_pep_unsupported(
  File "C:\Users\f1am3d\miniconda3\envs\pydml_torch2\lib\site-packages\beartype\_util\hint\pep\utilpeptest.py", line 205, in die_if_hint_pep_unsupported
    raise BeartypeDecorHintPep484Exception(
beartype.roar.BeartypeDecorHintPep484Exception: Function torch.onnx.symbolic_helper._onnx_unsupported() return PEP 484 type hint "typing.NoReturn" invalid in this type hint context (i.e., "typing.NoReturn" valid only as non-nested return annotation).

OS: Windows 11
GPU: Radeon 7900 XTX

same here😥

Same error
OS: Windows 10
GPU: RTX 3080 Mobile

Same here.
Windows 10
RTX 3090

How did everyone install Bark?

I ran the INSTALL_bark_infinity_windows.bat file, and the installation appeared to be successful (no errors popped up). However, I encounter this error when I run the launch file. I have also installed various things like Python, PyTorch, and NumPy for other program(with pip in global). I'm wondering if there might be a conflict.

I'll check it out Tuesday afternoon, didn't get a chance tonight. Enough people all having the same problem, must be something changed recently.

f1am3d commented

How did everyone install Bark?

Following these steps: https://github.com/JonathanFly/bark#-pytorch-20-bark-amd-install-test-pytorch-20-
And after the first unsuccessful attempt, these steps: https://github.com/JonathanFly/bark#%EF%B8%8F-this-amd-pytorch-1131-slower

I ran the 'INSTALL_BARK_INFINITY' (this seems to be an updated name from the docs).

Run COMMAND_LINE_BARK_INFINITY.bat

Then type pip install beartype>=0.16.1 --upgrade

After it finishes, close that window, and open the GUI or command line again and I think it should work.

If not, try also typing pip list and see what version it says next to beartype, if it's not version 0.16.1.

upgrading beartype to 0.16.1 did the trick! Thanks so much Jonathan!

Ok closing for now. I think we're past the age of beartype troubles.