daswer123 / rvc-python

Using RVC via console or python scripts
MIT License
81 stars 24 forks source link

Linux path error (\\base_model\\rmvpe.pt) #5

Open hAmos07 opened 9 months ago

hAmos07 commented 9 months ago

On Linux system get error: No such file or directory: '/usr/local/lib/python3.10/dist-packages/rvc_python\base_model\rmvpe.p

https://github.com/daswer123/rvc-python/blob/2dce847455214a31b789341482dd2ea16f04c852/rvc_python/modules/vc/pipeline.py#L151

  File "/usr/local/lib/python3.10/dist-packages/rvc_python/modules/vc/modules.py", line 184, in vc_single
    audio_opt = self.pipeline.pipeline(
  File "/usr/local/lib/python3.10/dist-packages/rvc_python/modules/vc/pipeline.py", line 359, in pipeline
    pitch, pitchf = self.get_f0(
  File "/usr/local/lib/python3.10/dist-packages/rvc_python/modules/vc/pipeline.py", line 152, in get_f0
    self.model_rmvpe = RMVPE(
  File "/usr/local/lib/python3.10/dist-packages/rvc_python/lib/rmvpe.py", line 563, in __init__
    self.model = get_default_model()
  File "/usr/local/lib/python3.10/dist-packages/rvc_python/lib/rmvpe.py", line 544, in get_default_model
    ckpt = torch.load(model_path, map_location="cpu")
  File "/usr/local/lib/python3.10/dist-packages/torch/serialization.py", line 998, in load
    with _open_file_like(f, 'rb') as opened_file:
  File "/usr/local/lib/python3.10/dist-packages/torch/serialization.py", line 445, in _open_file_like
    return _open_file(name_or_buffer, mode)
  File "/usr/local/lib/python3.10/dist-packages/torch/serialization.py", line 426, in __init__
    super().__init__(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.10/dist-packages/rvc_python\\base_model\\rmvpe.pt'
braydenchubb commented 9 months ago

Had this error too, it's a windows file path. For a temp fix you can change the line in modules/vc/pipeline.py to this:

rmvpe_path = Path(self.lib_dir) / "base_model" / "rmvpe.pt"

jakiestfu commented 9 months ago

+1 to this issue, can we get a fix @daswer123? 🙏

daswer123 commented 9 months ago

Hi, thanks braydenchubb for the fix, updated the python package

MisileLab commented 3 months ago

I think cross-platform solution is perfect like path.join