RVC-Project / Retrieval-based-Voice-Conversion

in preparation...
MIT License
240 stars 37 forks source link

Installed in virtual environment but permission denied with rvc commands (on Mac) #4

Closed briangrider closed 7 months ago

briangrider commented 7 months ago

Hi there,

I've installed this in a virtual environment but in trying to run rvc init I get:

zsh: permission denied: rvc

I'm kind of stuck at this point. Do you have any insight into how I could get this working? Thank you in advance!

briangrider commented 7 months ago

I was able to get it to open by right clicking and opening in terminal rvc in the bin and then copying and pasting that instead so like: "/Users/omni/Documents/rvc/projects/testing-rvc/venv/bin/python3.11" "/Users/omni/Documents/rvc/projects/testing-rvc/venv/bin/rvc"

This is ok but rvc-api doesn't work this way and it's generally not ideal. Any insight you have into getting it to work with the rvc and rvc-api commands on a mac would be very helpful!

briangrider commented 7 months ago

Now that I have it running (in the CLI) I've run into an error. Any insight would be greatly appreciated.

INFO:rvc.configs.config:No supported Nvidia GPU found INFO:rvc.configs.config:overwrite configs.json INFO:rvc.configs.config:Use mps instead INFO:rvc.configs.config:is_half:False, device:mps INFO:rvc.modules.vc.modules:Get sid: /Users/omni/Documents/rvc/weights/test.pth INFO:rvc.modules.vc.modules:Loading: /Users/omni/Documents/rvc/weights/test.pth /Users/omni/Documents/rvc/projects/rvc Desktop App/testing-rvc/venv/lib/python3.11/site-packages/torch/nn/utils/weight_norm.py:30: UserWarning: torch.nn.utils.weight_norm is deprecated in favor of torch.nn.utils.parametrizations.weight_norm. warnings.warn("torch.nn.utils.weight_norm is deprecated in favor of torch.nn.utils.parametrizations.weight_norm.") DEBUG:rvc.lib.infer_pack.models:gin_channels: 256, self.spk_embed_dim: 109 INFO:rvc.modules.vc.modules:Select index: WARNING:rvc.modules.vc.modules:Traceback (most recent call last): File "/Users/omni/Documents/rvc/projects/rvc Desktop App/testing-rvc/rvc/modules/vc/modules.py", line 114, in vc_single self.hubert_model = load_hubert(self.config, hubert_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/omni/Documents/rvc/projects/rvc Desktop App/testing-rvc/rvc/modules/vc/utils.py", line 23, in loadhubert models, , _ = checkpoint_utils.load_model_ensemble_and_task( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/omni/Documents/rvc/projects/rvc Desktop App/testing-rvc/venv/lib/python3.11/site-packages/fairseq/checkpoint_utils.py", line 448, in load_model_ensemble_and_task raise IOError("Model file not found: {}".format(filename)) OSError: Model file not found:

Traceback (most recent call last): File "/Users/omni/Documents/rvc/projects/rvc Desktop App/testing-rvc/venv/bin/rvc", line 6, in sys.exit(main()) ^^^^^^ File "/Users/omni/Documents/rvc/projects/rvc Desktop App/testing-rvc/rvc/utils/cli/cli.py", line 29, in main cli() File "/Users/omni/Documents/rvc/projects/rvc Desktop App/testing-rvc/venv/lib/python3.11/site-packages/click/core.py", line 1157, in call return self.main(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/omni/Documents/rvc/projects/rvc Desktop App/testing-rvc/venv/lib/python3.11/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/Users/omni/Documents/rvc/projects/rvc Desktop App/testing-rvc/venv/lib/python3.11/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/omni/Documents/rvc/projects/rvc Desktop App/testing-rvc/venv/lib/python3.11/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/omni/Documents/rvc/projects/rvc Desktop App/testing-rvc/venv/lib/python3.11/site-packages/click/core.py", line 783, in invoke return __callback(args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/omni/Documents/rvc/projects/rvc Desktop App/testing-rvc/rvc/utils/cli/handler/infer.py", line 130, in infer wavfile.write(outputpath, tgt_sr, audio_opt) File "/Users/omni/Documents/rvc/projects/rvc Desktop App/testing-rvc/venv/lib/python3.11/site-packages/scipy/io/wavfile.py", line 771, in write dkind = data.dtype.kind ^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'dtype'

briangrider commented 7 months ago

I believe this is because my hubert_path is set to nothing in .env but I'm not sure what I'm supposed to set it to

briangrider commented 7 months ago

I think maybe the init command isn't actually going through even though it's not giving an error. I see that there is a get hubert script that never ran so I manually added hubert and it looks like other files are missing. Now trying to resolve rmvpe.pt.

This can probably be traced back to my original issue of not being able to run the rvc command in a normal way. Let me know if you have any recommendations!

briangrider commented 7 months ago

Ok so I was able to get it working by copying rmvpe and hubert_base from the RVC Beta 0717 folder on hugging face and then explicitly adding their file paths to .env

If rvc init had the right permissions and was working properly, would all of this been automatic?

For anyone who needs it, here was my process:

  1. Install RVC in a Python 3.11 virtual environment (3.12 wouldn't work with torch)
  2. rvc commands wouldn't work for me, so I right-clicked rvc in the venv bin in vscode and selected run in terminal. I then copied that command (which is a python path and an rvc path) and used that in place of "rvc" whenever I want to run it
  3. rvc init didn't seem to do anything so I did rvc env create - set manual paths for rmvpe and hubert and grabbed them from the RVC Beta 0717 on hugging face
  4. run the rvc infer command using whatever settings you choose
  5. MPS didn't work on macbook air so I had to add this env variable - export PYTORCH_ENABLE_MPS_FALLBACK=1 - to ./venv/bin/activate - I added it after export PATH
  6. works!
briangrider commented 7 months ago

After all of that, I reinstalled the whole thing in another folder and it worked perfectly well! Very strange, but glad it was a fluke. Hopefully my journey helps someone else. Going to open a new issue for a problem I'm having with the api

ybwai commented 6 months ago

having the same issue @briangrider , how did you get it working on a fresh clone? these are the steps i am doing:

git clone https://github.com/RVC-Project/Retrieval-based-Voice-Conversion.git
python -m venv .venv && source .venv/bin/activate
poetry install
rvc init

the init shows no output but seems to do nothing...

Python 3.11.7 Poetry 1.7.1

briangrider commented 6 months ago

@beatsgithub I just ignored it and used env create

I also had to grab the hubert and rmvpe.pt from RVC 0717 beta from hugging face, put them in relative folders and put them in the env file

ybwai commented 6 months ago

yeh got it working in the same way thanks @briangrider seems the init script is empty and does nothing.