Retrieval-based-Voice-Conversion-WebUI
Retrieval-based-Voice-Conversion-WebUI copied to clipboard
AttributeError: 'NoneType' object has no attribute 'dtype'
File "D:\Lab\aivoice\RVC-beta-v2-0528\infer-web.py", line 184, in vc_single
audio_opt = vc.pipeline(
File "D:\Lab\aivoice\RVC-beta-v2-0528\vc_infer_pipeline.py", line 347, in pipeline
self.vc(
File "D:\Lab\aivoice\RVC-beta-v2-0528\vc_infer_pipeline.py", line 201, in vc
score, ix = index.search(npy, k=8)
File "D:\Lab\aivoice\RVC-beta-v2-0528\runtime\lib\site-packages\faiss\__init__.py", line 341, in replacement_search
assert d == self.d
AssertionError
Traceback (most recent call last):
File "D:\Lab\aivoice\RVC-beta-v2-0528\runtime\lib\site-packages\gradio\routes.py", line 321, in run_predict
output = await app.blocks.process_api(
File "D:\Lab\aivoice\RVC-beta-v2-0528\runtime\lib\site-packages\gradio\blocks.py", line 1007, in process_api
data = self.postprocess_data(fn_index, result["prediction"], state)
File "D:\Lab\aivoice\RVC-beta-v2-0528\runtime\lib\site-packages\gradio\blocks.py", line 953, in postprocess_data
prediction_value = block.postprocess(prediction_value)
File "D:\Lab\aivoice\RVC-beta-v2-0528\runtime\lib\site-packages\gradio\components.py", line 2076, in postprocess
processing_utils.audio_to_file(sample_rate, data, file.name)
File "D:\Lab\aivoice\RVC-beta-v2-0528\runtime\lib\site-packages\gradio\processing_utils.py", line 206, in audio_to_file
data = convert_to_16_bit_wav(data)
File "D:\Lab\aivoice\RVC-beta-v2-0528\runtime\lib\site-packages\gradio\processing_utils.py", line 219, in convert_to_16_bit_wav
if data.dtype in [np.float64, np.float32, np.float16]:
AttributeError: 'NoneType' object has no attribute 'dtype' ```
OS: Window 11
GPU: NVIDIA RTX 3060
New One
1、模型和索引的v1v2混用了 2、pip install torchcrepe==0.0.19再试试,不行就0.0.18,用runtime\Scipts\pip.exe装
In number 1 what do you mean by that?
Again
I'm having this same error message when trying to generate an output, whenever I put "Protect the artifact of voiceless consonant and breath. 0.5: don' use it. The number smaller, the stronger protection." on 0.5 the error goes away.
@RVC-Boss Same error. I am only using v1 model. Also working after moving "Protect the artifact of voiceless consonant and breath. 0.5: don' use it. The number smaller, the stronger protection." to 0.5.
I re-trained again and it fixed
@sourudev retraining did not help for me.
turning pitch extraction on did not help either. I will try to downgrade torchcrepe
Cleaned virtualenv and reinstalled requirements.txt with torchcrepe==0.0.18 and librosa==0.9.1. Retrained. Same error.
loading weights/abc.pth
gin_channels: 256 self.spk_embed_dim: 109
<All keys matched successfully>
Traceback (most recent call last):
File "C:\Users\rubyc\Documents\GitHub\Retrieval-based-Voice-Conversion-WebUI\infer-web.py", line 184, in vc_single
audio_opt = vc.pipeline(
File "C:\Users\rubyc\Documents\GitHub\Retrieval-based-Voice-Conversion-WebUI\vc_infer_pipeline.py", line 401, in pipeline
self.vc(
File "C:\Users\rubyc\Documents\GitHub\Retrieval-based-Voice-Conversion-WebUI\vc_infer_pipeline.py", line 227, in vc
pitchff = pitchf.clone()
AttributeError: 'NoneType' object has no attribute 'clone'
Traceback (most recent call last):
File "C:\Users\rubyc\anaconda3\envs\rvc\lib\site-packages\gradio\routes.py", line 414, in run_predict
output = await app.get_blocks().process_api(
File "C:\Users\rubyc\anaconda3\envs\rvc\lib\site-packages\gradio\blocks.py", line 1323, in process_api
data = self.postprocess_data(fn_index, result["prediction"], state)
File "C:\Users\rubyc\anaconda3\envs\rvc\lib\site-packages\gradio\blocks.py", line 1257, in postprocess_data
prediction_value = block.postprocess(prediction_value)
File "C:\Users\rubyc\anaconda3\envs\rvc\lib\site-packages\gradio\components.py", line 2531, in postprocess
processing_utils.audio_to_file(sample_rate, data, file.name)
File "C:\Users\rubyc\anaconda3\envs\rvc\lib\site-packages\gradio\processing_utils.py", line 163, in audio_to_file
data = convert_to_16_bit_wav(data)
File "C:\Users\rubyc\anaconda3\envs\rvc\lib\site-packages\gradio\processing_utils.py", line 177, in convert_to_16_bit_wav
if data.dtype in [np.float64, np.float32, np.float16]:
AttributeError: 'NoneType' object has no attribute 'dtype'
how to fix it? Traceback (most recent call last): File "/home/yyds/anaconda3/envs/rvc/lib/python3.9/site-packages/gradio/routes.py", line 414, in run_predict output = await app.get_blocks().process_api( File "/home/yyds/anaconda3/envs/rvc/lib/python3.9/site-packages/gradio/blocks.py", line 1323, in process_api data = self.postprocess_data(fn_index, result["prediction"], state) File "/home/yyds/anaconda3/envs/rvc/lib/python3.9/site-packages/gradio/blocks.py", line 1257, in postprocess_data prediction_value = block.postprocess(prediction_value) File "/home/yyds/anaconda3/envs/rvc/lib/python3.9/site-packages/gradio/components.py", line 2531, in postprocess processing_utils.audio_to_file(sample_rate, data, file.name) File "/home/yyds/anaconda3/envs/rvc/lib/python3.9/site-packages/gradio/processing_utils.py", line 163, in audio_to_file data = convert_to_16_bit_wav(data) File "/home/yyds/anaconda3/envs/rvc/lib/python3.9/site-packages/gradio/processing_utils.py", line 177, in convert_to_16_bit_wav if data.dtype in [np.float64, np.float32, np.float16]: AttributeError: 'NoneType' object has no attribute 'dtype'
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/a02019e4284daa7b8ed253ff450fdc7d534fa735/vc_infer_pipeline.py#L227
The reason that setting to 0.5 fixed the issue is because pitchf
is None
and if protect
is 0.5
, the code is skipped
0.5可以修复这个问题的原因是因为出错的时候pitchf
为None
,然后如果protect
设为0.5
,就不会跑出错的代码
What caused pitchf
to be None
?
@RVC-Boss 请问大佬,pitchf
在什么情况下会是None
?
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/a02019e4284daa7b8ed253ff450fdc7d534fa735/vc_infer_pipeline.py#L227
The reason that setting to 0.5 fixed the issue is because
pitchf
isNone
and ifprotect
is0.5
, the code is skipped 0.5 可以修復這個問題的原因是因為出錯的時候pitchf
為None
,然後如果protect
設為0.5
,就不會跑出錯的代碼What caused
pitchf
to beNone
? @RVC-Boss 請問大佬,pitchf
在什麼情況下會是None
?
一样的问题,torchcrepe也装了0.0.18版
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/a02019e4284daa7b8ed253ff450fdc7d534fa735/vc_infer_pipeline.py#L227
The reason that setting to 0.5 fixed the issue is because
pitchf
isNone
and ifprotect
is0.5
, the code is skipped 0.5 可以修復這個問題的原因是因為出錯的時候pitchf
為None
,然後如果protect
設為0.5
,就不會跑出錯的代碼What caused
pitchf
to beNone
? @RVC-Boss 請問大佬,pitchf
在什麼情況下會是None
?
噢,我这边的问题是训练时不带音高指导的话,就没法用那个功能;重新训练一个带音高指导的就ok了
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/a02019e4284daa7b8ed253ff450fdc7d534fa735/vc_infer_pipeline.py#L227
设置为 0.5 解决问题的原因是因为
pitchf
isNone
和 ifprotect
is0.5
,代码被跳过 0.5 可以修改这个问题的原因是因为出错的时候pitchf
为None
,然后如果protect
设置为0.5
,就不会跑出错误的代码 是什么造成pitchf
的None
?@RVC-Boss请问大佬,pitchf
在什么情况下会是None
?哦,我总结的问题是训练时不带音高指导的话,就没法用那个功能;重新训练一个带音高指导的就ok了
我带了高音特征提取了,感觉大家出错的都一样啊
I re-trained again and it fixed
What train settings did you use? with or without pitch v1 or v2?
I tried training with and without pitch model v1 and v2 with Protect 0, 0.33 and 0.5. pm, harvest and crepe. Always the same error.
The path is good no spaces no () only - _
Traceback (most recent call last):
File "V:\AI\Retrieval-based-Voice-Conversion-WebUI\my_utils.py", line 14, in load_audio
ffmpeg.input(file, threads=0)
File "C:\tools\miniconda3\envs\rvc\lib\site-packages\ffmpeg\_run.py", line 325, in run
raise Error('ffmpeg', out, err)
ffmpeg._run.Error: ffmpeg error (see stderr output for detail)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "V:\AI\Retrieval-based-Voice-Conversion-WebUI\infer-web.py", line 178, in vc_single
audio = load_audio(input_audio_path, 16000)
File "V:\AI\Retrieval-based-Voice-Conversion-WebUI\my_utils.py", line 19, in load_audio
raise RuntimeError(f"Failed to load audio: {e}")
RuntimeError: Failed to load audio: ffmpeg error (see stderr output for detail)
Traceback (most recent call last):
File "C:\tools\miniconda3\envs\rvc\lib\site-packages\gradio\routes.py", line 321, in run_predict
output = await app.blocks.process_api(
File "C:\tools\miniconda3\envs\rvc\lib\site-packages\gradio\blocks.py", line 1007, in process_api
data = self.postprocess_data(fn_index, result["prediction"], state)
File "C:\tools\miniconda3\envs\rvc\lib\site-packages\gradio\blocks.py", line 953, in postprocess_data
prediction_value = block.postprocess(prediction_value)
File "C:\tools\miniconda3\envs\rvc\lib\site-packages\gradio\components.py", line 2076, in postprocess
processing_utils.audio_to_file(sample_rate, data, file.name)
File "C:\tools\miniconda3\envs\rvc\lib\site-packages\gradio\processing_utils.py", line 206, in audio_to_file
data = convert_to_16_bit_wav(data)
File "C:\tools\miniconda3\envs\rvc\lib\site-packages\gradio\processing_utils.py", line 219, in convert_to_16_bit_wav
if data.dtype in [np.float64, np.float32, np.float16]:
AttributeError: 'NoneType' object has no attribute 'dtype'
If the NoneType error shows up on Windows when doing inference with a trained model, it may be caused by file replacement. The pth file of a model should be located directly in the Weights folder inside RVC, since this folder seemingly does not handle any subfolders.
Also, the "target" file i.e. the audio file the model is applied to should be located inside RVC ( not on one's own Google Drive ) if Colab is used. For this, create a new folder of any name in the Colab folder structure, and drag & drop the wav file from your computer inside it. Do keep a copy of this wav file on your own computer, since Colab does not store it. After this, copy the Colab path of this same file and use it as the location for your model's voice target instead of any Google Drive file.
A YouTube video "RVC Tutorial: The Easiest Vocal A.i. to date (Windows/Linux)" by P3tro has more on this subject. I won't insert a direct link to avoid any forum policy violations.
用自己训练的模型转换时报错:AttributeError: 'NoneType' object has no attribute 'clone',有大佬知道怎么解决吗