Retrieval-based-Voice-Conversion-WebUI icon indicating copy to clipboard operation
Retrieval-based-Voice-Conversion-WebUI copied to clipboard

推理时报AttributeError错误

Open FXDYJ opened this issue 11 months ago • 2 comments

完整日志 使用正确的index文件

O:\RVC-WebUi\RVC1006Nvidia>runtime\python.exe infer-web.py --pycmd runtime\python.exe --port 7897
2025-01-11 22:19:03 | INFO | configs.config | Found GPU NVIDIA P106-100, force to fp32
overwrite preprocess and configs.json
is_half:False, device:cuda:0
2025-01-11 22:19:07 | INFO | __main__ | Use Language: zh_CN
Running on local URL:  http://0.0.0.0:7897/ 
2025-01-11 22:19:16 | INFO | infer.modules.vc.modules | Get sid: cassie.pth
2025-01-11 22:19:16 | INFO | infer.modules.vc.modules | Loading: assets/weights/cassie.pth
2025-01-11 22:19:17 | INFO | infer.modules.vc.modules | Select index: logs\added_IVF882_Flat_nprobe_1_cassie_v2.index
2025-01-11 22:20:20 | WARNING | libav.mp3 | Estimating duration from bitrate, this may be inaccurate
2025-01-11 22:20:23 | INFO | infer.modules.vc.pipeline | Loading rmvpe model,assets/rmvpe/rmvpe.pt
2025-01-11 22:20:26 | WARNING | infer.modules.vc.modules | Traceback (most recent call last):
  File "O:\RVC-WebUi\RVC1006Nvidia\infer\modules\vc\modules.py", line 185, in vc_single
    audio_opt = self.pipeline.pipeline(
  File "O:\RVC-WebUi\RVC1006Nvidia\infer\modules\vc\pipeline.py", line 410, in pipeline
    self.vc(
  File "O:\RVC-WebUi\RVC1006Nvidia\infer\modules\vc\pipeline.py", line 235, in vc
    score, ix = index.search(npy, k=8)
  File "O:\RVC-WebUi\RVC1006Nvidia\runtime\lib\site-packages\faiss\__init__.py", line 341, in replacement_search
    assert d == self.d
AssertionError

Traceback (most recent call last):
  File "O:\RVC-WebUi\RVC1006Nvidia\runtime\lib\site-packages\gradio\routes.py", line 321, in run_predict
    output = await app.blocks.process_api(
  File "O:\RVC-WebUi\RVC1006Nvidia\runtime\lib\site-packages\gradio\blocks.py", line 1007, in process_api
    data = self.postprocess_data(fn_index, result["prediction"], state)
  File "O:\RVC-WebUi\RVC1006Nvidia\runtime\lib\site-packages\gradio\blocks.py", line 953, in postprocess_data
    prediction_value = block.postprocess(prediction_value)
  File "O:\RVC-WebUi\RVC1006Nvidia\runtime\lib\site-packages\gradio\components.py", line 2076, in postprocess
    processing_utils.audio_to_file(sample_rate, data, file.name)
  File "O:\RVC-WebUi\RVC1006Nvidia\runtime\lib\site-packages\gradio\processing_utils.py", line 206, in audio_to_file
    data = convert_to_16_bit_wav(data)
  File "O:\RVC-WebUi\RVC1006Nvidia\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'

不使用index文件/使用错误的index文件

2025-01-12 11:41:49 | INFO | infer.modules.vc.modules | Get sid:
2025-01-12 11:41:49 | INFO | infer.modules.vc.modules | Clean model cache
2025-01-12 11:41:51 | INFO | infer.modules.vc.modules | Get sid: cassie.pth
2025-01-12 11:41:51 | INFO | infer.modules.vc.modules | Loading: assets/weights/cassie.pth
2025-01-12 11:41:52 | INFO | infer.modules.vc.modules | Select index: logs\cassie\added_IVF882_Flat_nprobe_1_cassie_v2.index
2025-01-12 11:41:55 | WARNING | libav.mp3 | Estimating duration from bitrate, this may be inaccurate
2025-01-12 11:41:58 | INFO | infer.modules.vc.pipeline | Loading rmvpe model,assets/rmvpe/rmvpe.pt
2025-01-12 11:42:00 | WARNING | infer.modules.vc.modules | Traceback (most recent call last):
  File "O:\RVC-WebUi\RVC1006Nvidia\infer\modules\vc\modules.py", line 185, in vc_single
    audio_opt = self.pipeline.pipeline(
  File "O:\RVC-WebUi\RVC1006Nvidia\infer\modules\vc\pipeline.py", line 410, in pipeline
    self.vc(
  File "O:\RVC-WebUi\RVC1006Nvidia\infer\modules\vc\pipeline.py", line 221, in vc
    if protect < 0.5 and pitch is not None and pitchf is not None:
TypeError: '<' not supported between instances of 'dict' and 'float'

Traceback (most recent call last):
  File "O:\RVC-WebUi\RVC1006Nvidia\runtime\lib\site-packages\gradio\routes.py", line 321, in run_predict
    output = await app.blocks.process_api(
  File "O:\RVC-WebUi\RVC1006Nvidia\runtime\lib\site-packages\gradio\blocks.py", line 1007, in process_api
    data = self.postprocess_data(fn_index, result["prediction"], state)
  File "O:\RVC-WebUi\RVC1006Nvidia\runtime\lib\site-packages\gradio\blocks.py", line 953, in postprocess_data
    prediction_value = block.postprocess(prediction_value)
  File "O:\RVC-WebUi\RVC1006Nvidia\runtime\lib\site-packages\gradio\components.py", line 2076, in postprocess
    processing_utils.audio_to_file(sample_rate, data, file.name)
  File "O:\RVC-WebUi\RVC1006Nvidia\runtime\lib\site-packages\gradio\processing_utils.py", line 206, in audio_to_file
    data = convert_to_16_bit_wav(data)
  File "O:\RVC-WebUi\RVC1006Nvidia\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'

FXDYJ avatar Jan 12 '25 03:01 FXDYJ

遇到了同样的错误

hydrogen1222 avatar Feb 05 '25 15:02 hydrogen1222

I found the answer in this:

if protect < 0.5 TypeError: '<' not supported between instances of 'dict' and 'float'

Looked at the sliders and found an empty value that caused this error. Just set the value you need (default is 0.3 if I'm not mistaken). Image

In addition, if you still getting an error in gradio interface but no errors in the console, you will need to update gradio. I installed 3.48.0 instead of 3.34.0 and everything works fine. Activate your venv and run pip install gradio==3.48.0. In my case, it looks like this:

venv\Scripts\activate
pip install gradio==3.48.0

lethanner avatar Mar 02 '25 16:03 lethanner