snakers4 / silero-vad

Silero VAD: pre-trained enterprise-grade Voice Activity Detector
MIT License
4.41k stars 432 forks source link

Issue with loading after recent changes (invalid literal for int() with base 10: '0+cu113') #254

Closed vidklopcic closed 2 years ago

vidklopcic commented 2 years ago

After the recent changes I get this error. Is there an option to load with previous version or can I do anything to fix this issue?

Python 3.8.12 (default, Oct 12 2021, 13:49:34) 
[GCC 7.5.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.__version__
'1.11.0+cu113'
>>> silero, utils = torch.hub.load(repo_or_dir='snakers4/silero-vad',
...                                model='silero_vad',
...                                force_reload=False)
Using cache found in /root/.cache/torch/hub/snakers4_silero-vad_master
################################################################################
### WARNING, path does not exist: KALDI_ROOT=/mnt/matylda5/iveselyk/Tools/kaldi-trunk
###          (please add 'export KALDI_ROOT=<your_path>' in your $HOME/.profile)
###          (or run as: KALDI_ROOT=<your_path> python <your_script>.py)
################################################################################

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/conda/lib/python3.8/site-packages/torch/hub.py", line 404, in load
    model = _load_local(repo_or_dir, model, *args, **kwargs)
  File "/opt/conda/lib/python3.8/site-packages/torch/hub.py", line 433, in _load_local
    model = entry(*args, **kwargs)
  File "/root/.cache/torch/hub/snakers4_silero-vad_master/hubconf.py", line 31, in silero_vad
    if versiontuple(installed_version) < versiontuple(supported_version):
  File "/root/.cache/torch/hub/snakers4_silero-vad_master/hubconf.py", line 19, in versiontuple
    return tuple(map(int, (v.split("."))))
ValueError: invalid literal for int() with base 10: '0+cu113'
>>> 

This issue appeared after the latest commit (c7eab751b5f7e463cd17ec9e6a6c328c6bf3e4ee). It was already broken after the previous commit (94c79d899d121363b689814553881041c86f7dc1), but with different error:

>>> silero, utils = torch.hub.load(repo_or_dir='/app/silero-vad-6661cc969105f930152a0cfb780fee3c2937a1f0',
...                                model='silero_vad',
...                                source='local',
...                                force_reload=False)
################################################################################
### WARNING, path does not exist: KALDI_ROOT=/mnt/matylda5/iveselyk/Tools/kaldi-trunk
###          (please add 'export KALDI_ROOT=<your_path>' in your $HOME/.profile)
###          (or run as: KALDI_ROOT=<your_path> python <your_script>.py)
################################################################################

terminate called after throwing an instance of 'c10::Error'
  what():  isTuple()INTERNAL ASSERT FAILED at "../aten/src/ATen/core/ivalue_inl.h":1916, please report a bug to PyTorch. Expected Tuple but got String
Exception raised from toTupleRef at ../aten/src/ATen/core/ivalue_inl.h:1916 (most recent call first):
frame #0: c10::Error::Error(c10::SourceLocation, std::string) + 0x42 (0x7f5f4b81f7d2 in /opt/conda/lib/python3.8/site-packages/torch/lib/libc10.so)
frame #1: c10::detail::torchCheckFail(char const*, char const*, unsigned int, std::string const&) + 0x5b (0x7f5f4b81be6b in /opt/conda/lib/python3.8/site-packages/torch/lib/libc10.so)
frame #2: c10::detail::torchInternalAssertFail(char const*, char const*, unsigned int, char const*, std::string const&) + 0x3e (0x7f5f4b81c39e in /opt/conda/lib/python3.8/site-packages/torch/lib/libc10.so)
frame #3: <unknown function> + 0x336c826 (0x7f5f87a36826 in /opt/conda/lib/python3.8/site-packages/torch/lib/libtorch_cpu.so)
frame #4: <unknown function> + 0x336ca15 (0x7f5f87a36a15 in /opt/conda/lib/python3.8/site-packages/torch/lib/libtorch_cpu.so)
frame #5: torch::jit::SourceRange::highlight(std::ostream&) const + 0x36 (0x7f5f858e9666 in /opt/conda/lib/python3.8/site-packages/torch/lib/libtorch_cpu.so)
frame #6: torch::jit::ErrorReport::what() const + 0x2c5 (0x7f5f858cba85 in /opt/conda/lib/python3.8/site-packages/torch/lib/libtorch_cpu.so)
frame #7: <unknown function> + 0x1eceee (0x7f6000b23eee in /opt/conda/lib/python3.8/site-packages/torch/lib/libtorch_python.so)
frame #8: <unknown function> + 0x1f9ce8 (0x7f6000b30ce8 in /opt/conda/lib/python3.8/site-packages/torch/lib/libtorch_python.so)
<omitting python frames>
frame #37: __libc_start_main + 0xe7 (0x7f6002bfac87 in /lib/x86_64-linux-gnu/libc.so.6)

Aborted (core dumped)
adamnsandle commented 2 years ago

ValueError: invalid literal for int() with base 10: '0+cu113' Fixed this bug in latest commit

V4 VAD is supported by torch version 1.12.0 or higher

vidklopcic commented 2 years ago

Thanks!

vidklopcic commented 2 years ago

Is it possible to use the previous version? Using the tag v3.1 also throws this exception:

>>> silero, utils = torch.hub.load(repo_or_dir='snakers4/silero-vad:v3.1',
...                                model='silero_vad',
...                                force_reload=True)
Downloading: "https://github.com/snakers4/silero-vad/archive/v3.1.zip" to /root/.cache/torch/hub/v3.1.zip
################################################################################
### WARNING, path does not exist: KALDI_ROOT=/mnt/matylda5/iveselyk/Tools/kaldi-trunk
###          (please add 'export KALDI_ROOT=<your_path>' in your $HOME/.profile)
###          (or run as: KALDI_ROOT=<your_path> python <your_script>.py)
################################################################################

terminate called after throwing an instance of 'c10::Error'
  what():  isTuple()INTERNAL ASSERT FAILED at "../aten/src/ATen/core/ivalue_inl.h":1916, please report a bug to PyTorch. Expected Tuple but got String
Exception raised from toTupleRef at ../aten/src/ATen/core/ivalue_inl.h:1916 (most recent call first):
frame #0: c10::Error::Error(c10::SourceLocation, std::string) + 0x42 (0x7fc851e4f7d2 in /opt/conda/lib/python3.8/site-packages/torch/lib/libc10.so)
frame #1: c10::detail::torchCheckFail(char const*, char const*, unsigned int, std::string const&) + 0x5b (0x7fc851e4be6b in /opt/conda/lib/python3.8/site-packages/torch/lib/libc10.so)
frame #2: c10::detail::torchInternalAssertFail(char const*, char const*, unsigned int, char const*, std::string const&) + 0x3e (0x7fc851e4c39e in /opt/conda/lib/python3.8/site-packages/torch/lib/libc10.so)
frame #3: <unknown function> + 0x336c826 (0x7fc88e066826 in /opt/conda/lib/python3.8/site-packages/torch/lib/libtorch_cpu.so)
frame #4: <unknown function> + 0x336ca15 (0x7fc88e066a15 in /opt/conda/lib/python3.8/site-packages/torch/lib/libtorch_cpu.so)
frame #5: torch::jit::SourceRange::highlight(std::ostream&) const + 0x36 (0x7fc88bf19666 in /opt/conda/lib/python3.8/site-packages/torch/lib/libtorch_cpu.so)
frame #6: torch::jit::ErrorReport::what() const + 0x2c5 (0x7fc88befba85 in /opt/conda/lib/python3.8/site-packages/torch/lib/libtorch_cpu.so)
frame #7: <unknown function> + 0x1eceee (0x7fc907153eee in /opt/conda/lib/python3.8/site-packages/torch/lib/libtorch_python.so)
frame #8: <unknown function> + 0x1f9ce8 (0x7fc907160ce8 in /opt/conda/lib/python3.8/site-packages/torch/lib/libtorch_python.so)
<omitting python frames>
frame #37: __libc_start_main + 0xe7 (0x7fc90922ac87 in /lib/x86_64-linux-gnu/libc.so.6)

Aborted (core dumped)
snakers4 commented 2 years ago

Most likely previous version works with 1.10 or 1.11.