beartype.roar.BeartypeDecorHintPep484Exception: Function torch.onnx.symbolic_helper._onnx_unsupported() return PEP 484 type hint "typing.NoReturn" invalid in this type hint context #388

Open
opened 2023-09-16 07:43:21 +00:00 by KwamaEggStew · 7 comments

I was able to use this for a few days and made a few models with Colab.
I left home for a few hours and suddenly the Running block does not work anymore.
I did not make any edit to the codes.

Anyone else know what happened?

This is the traceback:

/content/ai-voice-cloning
./start.sh: line 3: ./venv/bin/activate: No such file or directory
Traceback (most recent call last):
File "/content/ai-voice-cloning/./src/main.py", line 11, in
from utils import *
File "/content/ai-voice-cloning/src/utils.py", line 28, in
import torch
File "/usr/local/lib/python3.10/dist-packages/torch/init.py", line 1239, in
from torch import onnx as onnx
File "/usr/local/lib/python3.10/dist-packages/torch/onnx/init.py", line 12, in
from . import ( # usort:skip. Keep the order instead of sorting lexicographically
File "/usr/local/lib/python3.10/dist-packages/torch/onnx/symbolic_caffe2.py", line 4, in
from torch.onnx import symbolic_helper, symbolic_opset9 as opset9
File "/usr/local/lib/python3.10/dist-packages/torch/onnx/symbolic_helper.py", line 611, in
def _onnx_unsupported(op_name: str, value: Optional[_C.Value] = None) -> NoReturn:
File "/usr/local/lib/python3.10/dist-packages/beartype/_decor/decorcache.py", line 77, in beartype
return beartype_object(obj, conf)
File "/usr/local/lib/python3.10/dist-packages/beartype/_decor/decorcore.py", line 98, in beartype_object
_beartype_object_fatal(obj, conf=conf, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/beartype/_decor/decorcore.py", line 147, in _beartype_object_fatal
beartype_nontype(obj, **kwargs) # type: ignore[return-value]
File "/usr/local/lib/python3.10/dist-packages/beartype/_decor/_decormore.py", line 178, in beartype_nontype
return beartype_func(obj, **kwargs) # type: ignore[return-value]
File "/usr/local/lib/python3.10/dist-packages/beartype/_decor/_decormore.py", line 242, in beartype_func
func_wrapper_code = generate_code(bear_call)
File "/usr/local/lib/python3.10/dist-packages/beartype/_decor/wrap/wrapmain.py", line 187, in generate_code
code_check_return = _code_check_return(bear_call)
File "/usr/local/lib/python3.10/dist-packages/beartype/_decor/wrap/wrapmain.py", line 669, in _code_check_return
reraise_exception_placeholder(
File "/usr/local/lib/python3.10/dist-packages/beartype/_util/error/utilerror.py", line 214, in reraise_exception_placeholder
raise exception.with_traceback(exception.traceback)
File "/usr/local/lib/python3.10/dist-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 "/usr/local/lib/python3.10/dist-packages/beartype/_util/cache/utilcachecall.py", line 259, in _callable_cached
raise exception
File "/usr/local/lib/python3.10/dist-packages/beartype/_util/cache/utilcachecall.py", line 251, in _callable_cached
return_value = args_flat_to_return_value[args_flat] = func(
File "/usr/local/lib/python3.10/dist-packages/beartype/_decor/wrap/_wrapcode.py", line 86, in make_func_wrapper_code
) = make_check_expr(hint, conf, cls_stack)
File "/usr/local/lib/python3.10/dist-packages/beartype/_util/cache/utilcachecall.py", line 259, in _callable_cached
raise exception
File "/usr/local/lib/python3.10/dist-packages/beartype/_util/cache/utilcachecall.py", line 251, in _callable_cached
return_value = args_flat_to_return_value[args_flat] = func(
File "/usr/local/lib/python3.10/dist-packages/beartype/_check/code/codemake.py", line 706, in make_check_expr
die_if_hint_pep_unsupported(
File "/usr/local/lib/python3.10/dist-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).
./start.sh: line 5: deactivate: command not found

I was able to use this for a few days and made a few models with Colab. I left home for a few hours and suddenly the Running block does not work anymore. I did not make any edit to the codes. Anyone else know what happened? This is the traceback: /content/ai-voice-cloning ./start.sh: line 3: ./venv/bin/activate: No such file or directory Traceback (most recent call last): File "/content/ai-voice-cloning/./src/main.py", line 11, in <module> from utils import * File "/content/ai-voice-cloning/src/utils.py", line 28, in <module> import torch File "/usr/local/lib/python3.10/dist-packages/torch/__init__.py", line 1239, in <module> from torch import onnx as onnx File "/usr/local/lib/python3.10/dist-packages/torch/onnx/__init__.py", line 12, in <module> from . import ( # usort:skip. Keep the order instead of sorting lexicographically File "/usr/local/lib/python3.10/dist-packages/torch/onnx/symbolic_caffe2.py", line 4, in <module> from torch.onnx import symbolic_helper, symbolic_opset9 as opset9 File "/usr/local/lib/python3.10/dist-packages/torch/onnx/symbolic_helper.py", line 611, in <module> def _onnx_unsupported(op_name: str, value: Optional[_C.Value] = None) -> NoReturn: File "/usr/local/lib/python3.10/dist-packages/beartype/_decor/decorcache.py", line 77, in beartype return beartype_object(obj, conf) File "/usr/local/lib/python3.10/dist-packages/beartype/_decor/decorcore.py", line 98, in beartype_object _beartype_object_fatal(obj, conf=conf, **kwargs) File "/usr/local/lib/python3.10/dist-packages/beartype/_decor/decorcore.py", line 147, in _beartype_object_fatal beartype_nontype(obj, **kwargs) # type: ignore[return-value] File "/usr/local/lib/python3.10/dist-packages/beartype/_decor/_decormore.py", line 178, in beartype_nontype return beartype_func(obj, **kwargs) # type: ignore[return-value] File "/usr/local/lib/python3.10/dist-packages/beartype/_decor/_decormore.py", line 242, in beartype_func func_wrapper_code = generate_code(bear_call) File "/usr/local/lib/python3.10/dist-packages/beartype/_decor/wrap/wrapmain.py", line 187, in generate_code code_check_return = _code_check_return(bear_call) File "/usr/local/lib/python3.10/dist-packages/beartype/_decor/wrap/wrapmain.py", line 669, in _code_check_return reraise_exception_placeholder( File "/usr/local/lib/python3.10/dist-packages/beartype/_util/error/utilerror.py", line 214, in reraise_exception_placeholder raise exception.with_traceback(exception.__traceback__) File "/usr/local/lib/python3.10/dist-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 "/usr/local/lib/python3.10/dist-packages/beartype/_util/cache/utilcachecall.py", line 259, in _callable_cached raise exception File "/usr/local/lib/python3.10/dist-packages/beartype/_util/cache/utilcachecall.py", line 251, in _callable_cached return_value = args_flat_to_return_value[args_flat] = func( File "/usr/local/lib/python3.10/dist-packages/beartype/_decor/wrap/_wrapcode.py", line 86, in make_func_wrapper_code ) = make_check_expr(hint, conf, cls_stack) File "/usr/local/lib/python3.10/dist-packages/beartype/_util/cache/utilcachecall.py", line 259, in _callable_cached raise exception File "/usr/local/lib/python3.10/dist-packages/beartype/_util/cache/utilcachecall.py", line 251, in _callable_cached return_value = args_flat_to_return_value[args_flat] = func( File "/usr/local/lib/python3.10/dist-packages/beartype/_check/code/codemake.py", line 706, in make_check_expr die_if_hint_pep_unsupported( File "/usr/local/lib/python3.10/dist-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). ./start.sh: line 5: deactivate: command not found

I actually have the same issue, but I haven't used it before. It's a fresh git clone and I'm trying to use directml on windows with python 3.9.13. With python 3.10 and 3.11 I had multiple issues with torch.

Traceback (most recent call last):
File "PathTo\ai-voice-cloning\src\main.py", line 11, in
from utils import *
File "PathTo\ai-voice-cloning\src\utils.py", line 28, in
import torch
File "PathTo\ai-voice-cloning\venv\lib\site-packages\torch_init_.py", line 1239, in
from torch import onnx as onnx
File "PathTo\ai-voice-cloning\venv\lib\site-packages\torch\onnx_init_.py", line 12, in
from . import ( # usort:skip. Keep the order instead of sorting lexicographically
File "PathTo\ai-voice-cloning\venv\lib\site-packages\torch\onnx\symbolic_caffe2.py", line 4, in
from torch.onnx import symbolic_helper, symbolic_opset9 as opset9
File "PathTo\ai-voice-cloning\venv\lib\site-packages\torch\onnx\symbolic_helper.py", line 611, in
def _onnx_unsupported(op_name: str, value: Optional[_C.Value] = None) -> NoReturn:
File "PathTo\ai-voice-cloning\venv\lib\site-packages\beartype_decor\decorcache.py", line 77, in beartype
return beartype_object(obj, conf)
File "PathTo\ai-voice-cloning\venv\lib\site-packages\beartype_decor\decorcore.py", line 98, in beartype_object
_beartype_object_fatal(obj, conf=conf, **kwargs)
File "PathTo\ai-voice-cloning\venv\lib\site-packages\beartype_decor\decorcore.py", line 147, in _beartype_object_fatal
beartype_nontype(obj, **kwargs) # type: ignore[return-value]
File "PathTo\ai-voice-cloning\venv\lib\site-packages\beartype_decor_decormore.py", line 178, in beartype_nontype
return beartype_func(obj, **kwargs) # type: ignore[return-value]
File "PathTo\ai-voice-cloning\venv\lib\site-packages\beartype_decor_decormore.py", line 242, in beartype_func
func_wrapper_code = generate_code(bear_call)
File "PathTo\ai-voice-cloning\venv\lib\site-packages\beartype_decor\wrap\wrapmain.py", line 187, in generate_code
code_check_return = _code_check_return(bear_call)
File "PathTo\ai-voice-cloning\venv\lib\site-packages\beartype_decor\wrap\wrapmain.py", line 669, in _code_check_return
reraise_exception_placeholder(
File "PathTo\ai-voice-cloning\venv\lib\site-packages\beartype_util\error\utilerror.py", line 214, in reraise_exception_placeholder
raise exception.with_traceback(exception.traceback)
File "PathTo\ai-voice-cloning\venv\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 "PathTo\ai-voice-cloning\venv\lib\site-packages\beartype_util\cache\utilcachecall.py", line 259, in _callable_cached
raise exception
File "PathTo\ai-voice-cloning\venv\lib\site-packages\beartype_util\cache\utilcachecall.py", line 251, in _callable_cached
return_value = args_flat_to_return_value[args_flat] = func(
File "PathTo\ai-voice-cloning\venv\lib\site-packages\beartype_decor\wrap_wrapcode.py", line 86, in make_func_wrapper_code
) = make_check_expr(hint, conf, cls_stack)
File "PathTo\ai-voice-cloning\venv\lib\site-packages\beartype_util\cache\utilcachecall.py", line 259, in _callable_cached
raise exception
File "PathTo\ai-voice-cloning\venv\lib\site-packages\beartype_util\cache\utilcachecall.py", line 251, in _callable_cached
return_value = args_flat_to_return_value[args_flat] = func(
File "PathTo\ai-voice-cloning\venv\lib\site-packages\beartype_check\code\codemake.py", line 706, in make_check_expr
die_if_hint_pep_unsupported(
File "PathTo\ai-voice-cloning\venv\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)

I actually have the same issue, but I haven't used it before. It's a fresh git clone and I'm trying to use directml on windows with python 3.9.13. With python 3.10 and 3.11 I had multiple issues with torch. Traceback (most recent call last): File "PathTo\ai-voice-cloning\src\main.py", line 11, in <module> from utils import * File "PathTo\ai-voice-cloning\src\utils.py", line 28, in <module> import torch File "PathTo\ai-voice-cloning\venv\lib\site-packages\torch\__init__.py", line 1239, in <module> from torch import onnx as onnx File "PathTo\ai-voice-cloning\venv\lib\site-packages\torch\onnx\__init__.py", line 12, in <module> from . import ( # usort:skip. Keep the order instead of sorting lexicographically File "PathTo\ai-voice-cloning\venv\lib\site-packages\torch\onnx\symbolic_caffe2.py", line 4, in <module> from torch.onnx import symbolic_helper, symbolic_opset9 as opset9 File "PathTo\ai-voice-cloning\venv\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 "PathTo\ai-voice-cloning\venv\lib\site-packages\beartype\_decor\decorcache.py", line 77, in beartype return beartype_object(obj, conf) File "PathTo\ai-voice-cloning\venv\lib\site-packages\beartype\_decor\decorcore.py", line 98, in beartype_object _beartype_object_fatal(obj, conf=conf, **kwargs) File "PathTo\ai-voice-cloning\venv\lib\site-packages\beartype\_decor\decorcore.py", line 147, in _beartype_object_fatal beartype_nontype(obj, **kwargs) # type: ignore[return-value] File "PathTo\ai-voice-cloning\venv\lib\site-packages\beartype\_decor\_decormore.py", line 178, in beartype_nontype return beartype_func(obj, **kwargs) # type: ignore[return-value] File "PathTo\ai-voice-cloning\venv\lib\site-packages\beartype\_decor\_decormore.py", line 242, in beartype_func func_wrapper_code = generate_code(bear_call) File "PathTo\ai-voice-cloning\venv\lib\site-packages\beartype\_decor\wrap\wrapmain.py", line 187, in generate_code code_check_return = _code_check_return(bear_call) File "PathTo\ai-voice-cloning\venv\lib\site-packages\beartype\_decor\wrap\wrapmain.py", line 669, in _code_check_return reraise_exception_placeholder( File "PathTo\ai-voice-cloning\venv\lib\site-packages\beartype\_util\error\utilerror.py", line 214, in reraise_exception_placeholder raise exception.with_traceback(exception.__traceback__) File "PathTo\ai-voice-cloning\venv\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 "PathTo\ai-voice-cloning\venv\lib\site-packages\beartype\_util\cache\utilcachecall.py", line 259, in _callable_cached raise exception File "PathTo\ai-voice-cloning\venv\lib\site-packages\beartype\_util\cache\utilcachecall.py", line 251, in _callable_cached return_value = args_flat_to_return_value[args_flat] = func( File "PathTo\ai-voice-cloning\venv\lib\site-packages\beartype\_decor\wrap\_wrapcode.py", line 86, in make_func_wrapper_code ) = make_check_expr(hint, conf, cls_stack) File "PathTo\ai-voice-cloning\venv\lib\site-packages\beartype\_util\cache\utilcachecall.py", line 259, in _callable_cached raise exception File "PathTo\ai-voice-cloning\venv\lib\site-packages\beartype\_util\cache\utilcachecall.py", line 251, in _callable_cached return_value = args_flat_to_return_value[args_flat] = func( File "PathTo\ai-voice-cloning\venv\lib\site-packages\beartype\_check\code\codemake.py", line 706, in make_check_expr die_if_hint_pep_unsupported( File "PathTo\ai-voice-cloning\venv\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)

to fix this issue, run this command inside your venv:
pip install beartype==0.15.0

to fix this issue, run this command inside your venv: `pip install beartype==0.15.0`

perfect, thanks for the quick reply!

perfect, thanks for the quick reply!

source ./venv/bin/activate
pip install beartype==0.15.0
deactivate

source ./venv/bin/activate pip install beartype==0.15.0 deactivate

So I ran that pip install beartype==0.15.0, but I still get the same error

So I ran that `pip install beartype==0.15.0`, but I still get the same error

So I ran that pip install beartype==0.15.0, but I still get the same error

pip install --force-reinstall -v "beartype==0.15.0

> So I ran that `pip install beartype==0.15.0`, but I still get the same error `pip install --force-reinstall -v "beartype==0.15.0`

So I ran that pip install beartype==0.15.0, but I still get the same error

pip install --force-reinstall -v "beartype==0.15.0

I did that and I get the same thing. Guess I just need to reinstall everything

> > So I ran that `pip install beartype==0.15.0`, but I still get the same error > > `pip install --force-reinstall -v "beartype==0.15.0` I did that and I get the same thing. Guess I just need to reinstall everything
Sign in to join this conversation.
No Milestone
No project
No Assignees
6 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: mrq/ai-voice-cloning#388
No description provided.