You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, getting this error when using the UVR.uvr_wrapper() function:
Loading UVR
Extracting vocals...
Traceback (most recent call last):
File "C:\Users\jeje9\Desktop\rvc_test\rvc_test.py", line 27, in <module>
for i in result:
File "C:\Users\jeje9\Desktop\rvc_test\lib\site-packages\rvc\modules\uvr5\modules.py", line 49, in uvr_wrapper
pre_fun = func(
File "C:\Users\jeje9\Desktop\rvc_test\lib\site-packages\rvc\modules\uvr5\vr.py", line 31, in __init__
mp = ModelParameters("rvc/lib/uvr5_pack/lib_v5/modelparams/4band_v2.json")
File "C:\Users\jeje9\Desktop\rvc_test\lib\site-packages\rvc\lib\uvr5_pack\lib_v5\model_param_init.py", line 55, in __init__
with open(config_path, "r") as f:
FileNotFoundError: [Errno 2] No such file or directory: 'rvc/lib/uvr5_pack/lib_v5/modelparams/4band_v2.json'
I made sure to look at the path, and the file does exist, so I'm thinking it might be an issue with the expected CWD since the path is relative.
For more info: I'm running python from a venv and using this command to run: ./Scripts/python.exe rvc_test.py from the C:\Users\jeje9\Desktop\rvc_test directory where the rvc_test.py file is
The text was updated successfully, but these errors were encountered:
This indeed seems to be the cause of the crash. I took the liberty to add a print statement in the source code, right before the call to open()
And got the path: C:\Users\jeje9\Desktop\rvc_test\rvc\lib\uvr5_pack\lib_v5\modelparams\4band_v2.json when the correct path should have been: C:\Users\jeje9\Desktop\rvc_test\lib\site-packages\rvc\lib\uvr5_pack\lib_v5\modelparams\4band_v2.json
Manually setting the CWD of the python script using os.chdir() fixes the issue on my end.
importosimportpydubcwd=os.getcwd()
ffmpeg_exec=cwd+"\\ffmpeg.exe"# or any other path to ffmpeg, as long as it is absolute and not relative.pydub.AudioSegment.converter=ffmpeg_execfromdotenvimportload_dotenvfromrvc.modules.uvr5.modulesimportUVR# downloaded model from:# https://github.com/TRvlvr/model_repo/releases/load_dotenv(".env")
print(cwd)
print("Loading UVR")
uvr=UVR()
print("Extracting vocals...")
os.chdir(cwd+"\\Lib\\site-packages")
result=uvr.uvr_wrapper(
model_name="2_HP-UVR.pth",
audio_path=cwd+"\\audio.wav",
save_vocal_path=cwd+"\\vocal",
save_ins_path=cwd+"\\inst",
agg=5,
export_format="wav",
temp_path=cwd+"\\tmp")
foriinresult:
print(i)
Hi, getting this error when using the UVR.uvr_wrapper() function:
Here is my code:
I made sure to look at the path, and the file does exist, so I'm thinking it might be an issue with the expected CWD since the path is relative.
For more info: I'm running python from a venv and using this command to run:
./Scripts/python.exe rvc_test.py
from theC:\Users\jeje9\Desktop\rvc_test
directory where thervc_test.py
file isThe text was updated successfully, but these errors were encountered: