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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid file: WindowsPath of encodec using Windows OS. #13

Closed
MartinEesmaa opened this issue Nov 6, 2022 · 4 comments
Closed

Invalid file: WindowsPath of encodec using Windows OS. #13

MartinEesmaa opened this issue Nov 6, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@MartinEesmaa
Copy link

馃悰 Bug Report

When I tried to encode from WAV to ECDC file, python gave me an error for invalid file using Windows OS. On Linux, works well, but only Windows OS did not work.

To Reproduce

  1. Install encodec using pip install .
  2. Install pysoundfile using pip
  3. Encode from uncompressed WAV to encodec (.ecdc)

Expected behavior

Encode success from WAV to ECDC.

Actual Behavior

Saying invalid file for trying find WAV file

Your Environment

The error code is for Windows OS only:

encodec -b 24 -r MSESTONIA.wav MSESTONIA.ecdc
Traceback (most recent call last):
  File "C:\Users\marti\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\marti\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\marti\AppData\Local\Programs\Python\Python310\Scripts\encodec.exe\__main__.py", line 7, in <module>
  File "C:\Users\marti\AppData\Local\Programs\Python\Python310\lib\site-packages\encodec\__main__.py", line 109, in main
    wav, sr = torchaudio.load(args.input)
  File "C:\Users\marti\AppData\Roaming\Python\Python310\site-packages\torchaudio\backend\soundfile_backend.py", line 205, in load
    with soundfile.SoundFile(filepath, "r") as file_:
  File "C:\Users\marti\AppData\Local\Programs\Python\Python310\lib\site-packages\soundfile.py", line 740, in __init__
    self._file = self._open(file, mode_int, closefd)
  File "C:\Users\marti\AppData\Local\Programs\Python\Python310\lib\site-packages\soundfile.py", line 1263, in _open
    raise TypeError("Invalid file: {0!r}".format(self.name))
TypeError: Invalid file: WindowsPath('MSESTONIA.wav')
  • Python and PyTorch version: Python 3.10.8 and Pytorch 1.13.0+cu117

  • Operating system and version (desktop or mobile): Windows 11 (desktop)

  • Hardware (gpu or cpu, amount of RAM etc.): NVIDIA RTX 3060 Laptop GUI, 16 GB RAM.

  • Martin Eesmaa

@MartinEesmaa MartinEesmaa added the bug Something isn't working label Nov 6, 2022
@Limeysoda1
Copy link

I think I solved this by 'pip install librosa'

@MartinEesmaa
Copy link
Author

Thanks @Limeysoda1, but I got a different error. I think maybe issue for PyTorch:

Traceback (most recent call last):
  File "C:\Users\marti\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\marti\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\marti\AppData\Local\Programs\Python\Python310\Scripts\encodec.exe\__main__.py", line 7, in <module>
  File "C:\Users\marti\AppData\Local\Programs\Python\Python310\lib\site-packages\encodec\__main__.py", line 111, in main
    compressed = compress(model, wav, use_lm=args.lm)
  File "C:\Users\marti\AppData\Local\Programs\Python\Python310\lib\site-packages\encodec\compress.py", line 172, in compress
    compress_to_file(model, wav, fo, use_lm=use_lm)
  File "C:\Users\marti\AppData\Local\Programs\Python\Python310\lib\site-packages\encodec\compress.py", line 51, in compress_to_file
    frames = model.encode(wav[None])
  File "C:\Users\marti\AppData\Local\Programs\Python\Python310\lib\site-packages\encodec\model.py", line 144, in encode
    encoded_frames.append(self._encode_frame(frame))
  File "C:\Users\marti\AppData\Local\Programs\Python\Python310\lib\site-packages\encodec\model.py", line 161, in _encode_frame
    emb = self.encoder(x)
  File "C:\Users\marti\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1190, in _call_impl
    return forward_call(*input, **kwargs)
  File "C:\Users\marti\AppData\Local\Programs\Python\Python310\lib\site-packages\encodec\modules\seanet.py", line 144, in forward
    return self.model(x)
  File "C:\Users\marti\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1190, in _call_impl
    return forward_call(*input, **kwargs)
  File "C:\Users\marti\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\container.py", line 204, in forward
    input = module(input)
  File "C:\Users\marti\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1190, in _call_impl
    return forward_call(*input, **kwargs)
  File "C:\Users\marti\AppData\Local\Programs\Python\Python310\lib\site-packages\encodec\modules\seanet.py", line 63, in forward
    return self.shortcut(x) + self.block(x)
  File "C:\Users\marti\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1190, in _call_impl
    return forward_call(*input, **kwargs)
  File "C:\Users\marti\AppData\Local\Programs\Python\Python310\lib\site-packages\encodec\modules\conv.py", line 210, in forward
    return self.conv(x)
  File "C:\Users\marti\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1190, in _call_impl
    return forward_call(*input, **kwargs)
  File "C:\Users\marti\AppData\Local\Programs\Python\Python310\lib\site-packages\encodec\modules\conv.py", line 120, in forward
    x = self.conv(x)
  File "C:\Users\marti\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1208, in _call_impl
    result = forward_call(*input, **kwargs)
  File "C:\Users\marti\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\conv.py", line 313, in forward
    return self._conv_forward(input, self.weight, self.bias)
  File "C:\Users\marti\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\conv.py", line 309, in _conv_forward
    return F.conv1d(input, weight, bias, self.stride,
RuntimeError: could not create a primitive

Torch versions:

torch                     1.13.0+cu117
torchaudio                0.13.0+cu117

@adefossez
Copy link
Contributor

It is possible that your CPU doesn't support some of the instruction sets required by PyTorch. You should open an issue with PyTorch as this is not really related to the our code.

@MartinEesmaa
Copy link
Author

Oh, I see, thank you. I will submit the issue in PyTorch and this repository will be closed my issue by myself.

  • Martin Eesmaa

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

3 participants