Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binary search failed #85

Open
makdisse opened this issue Oct 12, 2024 · 0 comments
Open

Binary search failed #85

makdisse opened this issue Oct 12, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@makdisse
Copy link

🐛 Bug Report

When you encode in one hardware and try to decode on a different machine it will fail to decode even using the same versions for all libraries.

To Reproduce

  1. Encode a file on a machine that has no GPU or ir a notebook (I'm not sure what hardware difference is causing the error TBH)
  2. Try to decode the file on a machine that has a GPU or is a desktop (must be totally different hardware)

Expected behavior

It should decode as both machines are using encodec 0.1.1 and torch 2.4.1 and python 3.9.13

Actual Behavior

The decoding fails with this error:

PS E:\voice_notes\decode> python.exe -m encodec .\20241009121035.wav.ecdc
Traceback (most recent call last):
  File "C:\Users\Paulo\scoop\apps\python39\current\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\Paulo\scoop\apps\python39\current\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\Paulo\scoop\apps\python39\current\lib\site-packages\encodec\__main__.py", line 123, in <module>
    main()
  File "C:\Users\Paulo\scoop\apps\python39\current\lib\site-packages\encodec\__main__.py", line 92, in main
    out, out_sample_rate = decompress(args.input.read_bytes())
  File "C:\Users\Paulo\scoop\apps\python39\current\lib\site-packages\encodec\compress.py", line 185, in decompress
    return decompress_from_file(fo, device=device)
  File "C:\Users\Paulo\scoop\apps\python39\current\lib\site-packages\encodec\compress.py", line 143, in decompress_from_file
    code = decoder.pull(q_cdf)
  File "C:\Users\Paulo\scoop\apps\python39\current\lib\site-packages\encodec\quantization\ac.py", line 255, in pull
    sym, self.low, self.high, self.current = bin_search(0, len(quantized_cdf) - 1)
  File "C:\Users\Paulo\scoop\apps\python39\current\lib\site-packages\encodec\quantization\ac.py", line 250, in bin_search
    return bin_search(mid + 1, high_idx)
  File "C:\Users\Paulo\scoop\apps\python39\current\lib\site-packages\encodec\quantization\ac.py", line 250, in bin_search
    return bin_search(mid + 1, high_idx)
  File "C:\Users\Paulo\scoop\apps\python39\current\lib\site-packages\encodec\quantization\ac.py", line 252, in bin_search
    return bin_search(low_idx, mid - 1)
  File "C:\Users\Paulo\scoop\apps\python39\current\lib\site-packages\encodec\quantization\ac.py", line 252, in bin_search
    return bin_search(low_idx, mid - 1)
  File "C:\Users\Paulo\scoop\apps\python39\current\lib\site-packages\encodec\quantization\ac.py", line 252, in bin_search
    return bin_search(low_idx, mid - 1)
  File "C:\Users\Paulo\scoop\apps\python39\current\lib\site-packages\encodec\quantization\ac.py", line 250, in bin_search
    return bin_search(mid + 1, high_idx)
  File "C:\Users\Paulo\scoop\apps\python39\current\lib\site-packages\encodec\quantization\ac.py", line 250, in bin_search
    return bin_search(mid + 1, high_idx)
  File "C:\Users\Paulo\scoop\apps\python39\current\lib\site-packages\encodec\quantization\ac.py", line 250, in bin_search
    return bin_search(mid + 1, high_idx)
  [Previous line repeated 1 more time]
  File "C:\Users\Paulo\scoop\apps\python39\current\lib\site-packages\encodec\quantization\ac.py", line 252, in bin_search
    return bin_search(low_idx, mid - 1)
  File "C:\Users\Paulo\scoop\apps\python39\current\lib\site-packages\encodec\quantization\ac.py", line 238, in bin_search
    raise RuntimeError("Binary search failed")
RuntimeError: Binary search failed

It has happened multiple times using different machines. I have old encoded files that I am unable to decode on any machine now.

Your Environment

  • Python and PyTorch version: python 3.9.13, torch 2.4.1
  • Operating system and version (desktop or mobile): windows 11 on both machines
  • Hardware (gpu or cpu, amount of RAM etc.):
    machine A - encoder) 16gb, notebook, Intel(R) Pentium(R) CPU 4405U @ 2.10GHz
    machine B - decoder) 48gb, AMD Ryzen 5 3600 6-Core Processor
@makdisse makdisse added the bug Something isn't working label Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant