[GH-ISSUE #44] TypeError: expected str, bytes or os.PathLike object, not NoneType #33

Closed
opened 2026-10-20 09:53:18 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @Dartvauder on GitHub (Sep 18, 2024).
Original GitHub issue: https://github.com/RVC-Project/Retrieval-based-Voice-Conversion/issues/44

PS C:\NeuroNetworks\NeuroSandboxWebUI\inputs\audio\rvc_models\Retrieval-based-Voice-Conversion> rvc infer -m "C:\NeuroNetworks\NeuroSandboxWebUI\inputs\audio\rvc_models\Oxxxymiron_v2_1020e\Oxxxymiron_e1020_s19380.pth" -i "input.wav" -o "output.wav"
2024-09-18 21:00:58 | INFO | rvc.configs.config | No supported Nvidia GPU found
2024-09-18 21:00:58 | INFO | rvc.configs.config | overwrite configs.json
2024-09-18 21:00:58 | INFO | rvc.configs.config | Use cpu instead
2024-09-18 21:00:58 | INFO | rvc.configs.config | is_half:False, device:cpu
2024-09-18 21:00:58 | INFO | rvc.modules.vc.modules | Get sid: Oxxxymiron_e1020_s19380.pth
2024-09-18 21:00:58 | INFO | rvc.modules.vc.modules | Loading: C:\NeuroNetworks\NeuroSandboxWebUI\inputs\audio\rvc_models\Oxxxymiron_v2_1020e\Oxxxymiron_e1020_s19380.pth
C:\Users\dartv\AppData\Local\Programs\Python\Python310\lib\site-packages\rvc\modules\vc\modules.py:50: FutureWarning: You are using torch.load with weights_only=False (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for weights_only will be flipped to True. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via torch.serialization.add_safe_globals. We recommend you start setting weights_only=True for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
self.cpt = torch.load(person, map_location="cpu")
C:\Users\dartv\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\utils\weight_norm.py:134: FutureWarning: torch.nn.utils.weight_norm is deprecated in favor of torch.nn.utils.parametrizations.weight_norm.
WeightNorm.apply(module, name, dim)
Traceback (most recent call last):
File "C:\Users\dartv\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\dartv\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "C:\Users\dartv\AppData\Local\Programs\Python\Python310\Scripts\rvc.exe_main
.py", line 7, in
File "C:\Users\dartv\AppData\Local\Programs\Python\Python310\lib\site-packages\rvc\wrapper\cli\cli.py", line 29, in main
cli()
File "C:\Users\dartv\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1157, in call
return self.main(*args, **kwargs)
File "C:\Users\dartv\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1078, in main
rv = self.invoke(ctx)
File "C:\Users\dartv\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "C:\Users\dartv\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Users\dartv\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "C:\Users\dartv\AppData\Local\Programs\Python\Python310\lib\site-packages\rvc\wrapper\cli\handler\infer.py", line 114, in infer
vc.get_vc(modelpath)
File "C:\Users\dartv\AppData\Local\Programs\Python\Python310\lib\site-packages\rvc\modules\vc\modules.py", line 83, in get_vc
index = get_index_path_from_model(sid)
File "C:\Users\dartv\AppData\Local\Programs\Python\Python310\lib\site-packages\rvc\modules\vc\utils.py", line 12, in get_index_path_from_model
for root, _, files in os.walk(os.getenv("index_root"), topdown=False)
File "C:\Users\dartv\AppData\Local\Programs\Python\Python310\lib\os.py", line 343, in walk
return _walk(fspath(top), topdown, onerror, followlinks)
TypeError: expected str, bytes or os.PathLike object, not NoneType

Originally created by @Dartvauder on GitHub (Sep 18, 2024). Original GitHub issue: https://github.com/RVC-Project/Retrieval-based-Voice-Conversion/issues/44 PS C:\NeuroNetworks\NeuroSandboxWebUI\inputs\audio\rvc_models\Retrieval-based-Voice-Conversion> rvc infer -m "C:\NeuroNetworks\NeuroSandboxWebUI\inputs\audio\rvc_models\Oxxxymiron_v2_1020e\Oxxxymiron_e1020_s19380.pth" -i "input.wav" -o "output.wav" 2024-09-18 21:00:58 | INFO | rvc.configs.config | No supported Nvidia GPU found 2024-09-18 21:00:58 | INFO | rvc.configs.config | overwrite configs.json 2024-09-18 21:00:58 | INFO | rvc.configs.config | Use cpu instead 2024-09-18 21:00:58 | INFO | rvc.configs.config | is_half:False, device:cpu 2024-09-18 21:00:58 | INFO | rvc.modules.vc.modules | Get sid: Oxxxymiron_e1020_s19380.pth 2024-09-18 21:00:58 | INFO | rvc.modules.vc.modules | Loading: C:\NeuroNetworks\NeuroSandboxWebUI\inputs\audio\rvc_models\Oxxxymiron_v2_1020e\Oxxxymiron_e1020_s19380.pth C:\Users\dartv\AppData\Local\Programs\Python\Python310\lib\site-packages\rvc\modules\vc\modules.py:50: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature. self.cpt = torch.load(person, map_location="cpu") C:\Users\dartv\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\utils\weight_norm.py:134: FutureWarning: `torch.nn.utils.weight_norm` is deprecated in favor of `torch.nn.utils.parametrizations.weight_norm`. WeightNorm.apply(module, name, dim) Traceback (most recent call last): File "C:\Users\dartv\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\dartv\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\Users\dartv\AppData\Local\Programs\Python\Python310\Scripts\rvc.exe\__main__.py", line 7, in <module> File "C:\Users\dartv\AppData\Local\Programs\Python\Python310\lib\site-packages\rvc\wrapper\cli\cli.py", line 29, in main cli() File "C:\Users\dartv\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1157, in __call__ return self.main(*args, **kwargs) File "C:\Users\dartv\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1078, in main rv = self.invoke(ctx) File "C:\Users\dartv\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "C:\Users\dartv\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1434, in invoke return ctx.invoke(self.callback, **ctx.params) File "C:\Users\dartv\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 783, in invoke return __callback(*args, **kwargs) File "C:\Users\dartv\AppData\Local\Programs\Python\Python310\lib\site-packages\rvc\wrapper\cli\handler\infer.py", line 114, in infer vc.get_vc(modelpath) File "C:\Users\dartv\AppData\Local\Programs\Python\Python310\lib\site-packages\rvc\modules\vc\modules.py", line 83, in get_vc index = get_index_path_from_model(sid) File "C:\Users\dartv\AppData\Local\Programs\Python\Python310\lib\site-packages\rvc\modules\vc\utils.py", line 12, in get_index_path_from_model for root, _, files in os.walk(os.getenv("index_root"), topdown=False) File "C:\Users\dartv\AppData\Local\Programs\Python\Python310\lib\os.py", line 343, in walk return _walk(fspath(top), topdown, onerror, followlinks) TypeError: expected str, bytes or os.PathLike object, not NoneType
Author
Owner

@alcoftTAO commented on GitHub (Sep 18, 2024):

I think the problem might be the index_root environment variable is not set.
Try typing in the PowerShell $env:index_root = "" and running RVC again.
If it still fails, try typing $env:index_root = (Get-Location) and running RVC again.

I don't know if this can fix it or if this is really a solution. It worked for me, but I'm using the Python library and I'm on Linux, I have no idea if this works on Windows.

<!-- gh-comment-id:2359130048 --> @alcoftTAO commented on GitHub (Sep 18, 2024): I think the problem might be the `index_root` environment variable is not set. Try typing in the PowerShell `$env:index_root = ""` and running RVC again. If it still fails, try typing `$env:index_root = (Get-Location)` and running RVC again. I don't know if this can fix it or if this is really a solution. It worked for me, but I'm using the Python library and I'm on Linux, I have no idea if this works on Windows.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
RVC-Project/Retrieval-based-Voice-Conversion#33
No description provided.