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

AttributeError: 'NoneType' object has no attribute 'dtype'

Open cinnabarromance opened this issue 1 year ago • 29 comments

I got to Model Inference, and then this happened. What should I do?

Traceback (most recent call last): File "D:\programms\RVC-beta\RVC-beta-v2-0528\infer-web.py", line 161, in vc_single audio = load_audio(input_audio_path, 16000) File "D:\programms\RVC-beta\RVC-beta-v2-0528\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 "D:\programms\RVC-beta\RVC-beta-v2-0528\runtime\lib\site-packages\gradio\routes.py", line 321, in run_predict output = await app.blocks.process_api( File "D:\programms\RVC-beta\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:\programms\RVC-beta\RVC-beta-v2-0528\runtime\lib\site-packages\gradio\blocks.py", line 953, in postprocess_data prediction_value = block.postprocess(prediction_value) File "D:\programms\RVC-beta\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:\programms\RVC-beta\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:\programms\RVC-beta\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'

cinnabarromance avatar Jun 14 '23 19:06 cinnabarromance

I get the same error. Standalone, latest version. I have the FFMPEG in the system path.

EDIT: This error only happens if you use model that has been trained with the 'model pitch guidance' set to FALSE. If you want to use that model, you have to set "Protect the artifact of voiceless consonant and breath. 0.5: don' use it. The number smaller, the stronger protection." to 0.5 - the error goes away.

VAM-Kitten avatar Jun 17 '23 09:06 VAM-Kitten

@VAM-Kitten, I tried that but still get the error 😢

Ma5onic avatar Jun 17 '23 17:06 Ma5onic

@VAM-Kitten I trained it with it set to TRUE and I still get the error

Rainbowgunsh avatar Jun 17 '23 20:06 Rainbowgunsh

I get the same error. Standalone, latest version. I have the FFMPEG in the system path.

EDIT: This error only happens if you use model that has been trained with the 'model pitch guidance' set to FALSE. If you want to use that model, you have to set "Protect the artifact of voiceless consonant and breath. 0.5: don' use it. The number smaller, the stronger protection." to 0.5 - the error goes away.

It is not working, I tried too.

cinnabarromance avatar Jun 18 '23 06:06 cinnabarromance

I have the same problem, how to solve it?

yingshow avatar Jun 18 '23 13:06 yingshow

It seems that this problem just went down due to new problems that appeared. BUT I still have not found an answer and a solution to the problem, like other users. What to do?

cinnabarromance avatar Jun 20 '23 16:06 cinnabarromance

If you are on windows make sure that your path has a \ at the end. You will also get this error if the audio can't be found.

Ma5onic avatar Jun 20 '23 22:06 Ma5onic

If you are on windows make sure that your path has a \ at the end. You will also get this error if the audio can't be found.

This error persists no matter what I do. I correctly indicated the address and the name of the song, I subtracted the values, as mentioned above. Nothing works.

cinnabarromance avatar Jun 21 '23 19:06 cinnabarromance

I believe I have found the fix, download hubert_base.pt here:

https://huggingface.co/lj1995/VoiceConversionWebUI/tree/main and place it in the same directory as go-web.bat

restart the webui and try again, seems to have fixed my issue. voice doesn't sound as i expected but it may just be bad training on my end

Phoenixlink1 avatar Jun 26 '23 02:06 Phoenixlink1

I believe I have found the fix, download hubert_base.pt here:

https://huggingface.co/lj1995/VoiceConversionWebUI/tree/main and place it in the same directory as go-web.bat

restart the webui and try again, seems to have fixed my issue. voice doesn't sound as i expected but it may just be bad training on my end

Mine already had that file in the right place originally and when I did it again replacing the original file with the new one you referenced (incase it got updated) still didn't work :(

Rainbowgunsh avatar Jun 26 '23 03:06 Rainbowgunsh

I believe I have found the fix, download hubert_base.pt here: https://huggingface.co/lj1995/VoiceConversionWebUI/tree/main and place it in the same directory as go-web.bat restart the webui and try again, seems to have fixed my issue. voice doesn't sound as i expected but it may just be bad training on my end

Mine already had that file in the right place originally and when I did it again replacing the original file with the new one you referenced (incase it got updated) still didn't work :(

ah, sorry to hear. It seems for me my download did not contain all the necessary files

I've seen some suggestions in other threads stating you might have luck by removing spaces from the input file name and making sure it's .wav, perhaps try downloading someone else's model and weights to see if it could be model dependent?

Phoenixlink1 avatar Jun 26 '23 03:06 Phoenixlink1

I've seen some suggestions in other threads stating you might have luck by removing spaces from the input file name and making sure it's .wav, perhaps try downloading someone else's model and weights to see if it could be model dependent?

tried with a few different models but still no luck :(

Rainbowgunsh avatar Jun 26 '23 05:06 Rainbowgunsh

I've trained my model with and without pitch guidance all in model v2 and v1. I Tried 0 protection 0.33 and 0.5, harvest crepe and pm give the same error. The path is good no spaces no () only - _

Anyone had luck in solving this?

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'

leaper-max avatar Jun 29 '23 01:06 leaper-max

I fixed the issue. You need to add ".wav" to the end of your file (if wav) EXAMPLE: \instrument_Balling song.mp3_10.wav <-- add wav to end of directory NOT rename. If mp3 do ".mp3" etc etc

Rainbowgunsh avatar Jul 10 '23 04:07 Rainbowgunsh

I fixed the issue. You need to add ".wav" to the end of your file (if wav) EXAMPLE: \instrument_Balling song.mp3_10.wav <-- add wav to end of directory NOT rename. If mp3 do ".mp3" etc etc

I'm sorry, I don't quite understand what you said. Do I need to add a .wav suffix to the filename of the wav file?

youngboi2C avatar Jul 10 '23 06:07 youngboi2C

I fixed the issue. You need to add ".wav" to the end of your file (if wav) EXAMPLE: \instrument_Balling song.mp3_10.wav <-- add wav to end of directory NOT rename. If mp3 do ".mp3" etc etc

I'm sorry, I don't quite understand what you said. Do I need to add a .wav suffix to the filename of the wav file?

What he's saying is you have to add the file type suffix when entering the path for the file in the PROGRAM, so D:\acapella\vocals.wav not D:\acapella or D:\acapella\vocals

nightwalkerrrrr avatar Jul 15 '23 16:07 nightwalkerrrrr

提醒一下各位,我出现这个问题是因为没有选择推理音色,以为只要选择index路径就可以。顺便一提,模型文件最好直接放在weight文件夹下,否则无法查找到。

As a reminder, I had this problem because I didn't select the inference tone, thinking that I just had to select the index path. By the way, it's best to put the model files directly under the weight folder, otherwise they won't be found.

Chaoriticle avatar Aug 01 '23 04:08 Chaoriticle

It might be a GPU error? I had exact same issue with my GTX 980 Ti 6gb, problem gone with my RTX 4070 12gb

Hellzicke avatar Aug 04 '23 12:08 Hellzicke

I'm getting this with every model I've found. I tried the suggestions above (file name is "vox.wav"). I've also tried multiple file formats (wav, aif, mp3).

Any other ideas?

gigamesh avatar Aug 26 '23 01:08 gigamesh

Using HP2 instead of HP3 to separate the vocals solved it for me.

ardanimo avatar Sep 04 '23 10:09 ardanimo

I fixed the issue. You need to add ".wav" to the end of your file (if wav) EXAMPLE: \instrument_Balling song.mp3_10.wav <-- add wav to end of directory NOT rename. If mp3 do ".mp3" etc etc

I'm sorry, I don't quite understand what you said. Do I need to add a .wav suffix to the filename of the wav file?

What he's saying is you have to add the file type suffix when entering the path for the file in the PROGRAM, so D:\acapella\vocals.wav not D:\acapella or D:\acapella\vocals

actually fixxed it!

ClasSiXdAk1nG avatar Nov 01 '23 17:11 ClasSiXdAk1nG

i have solved this, we are doing a little mistake while choosing the path of the file. do not copy from uper bar just right click on the file we want to use and simply copy the file path, that's it

tahirsab avatar Nov 15 '23 19:11 tahirsab

I had this problem for a while, I looked everywhere but I didn't find a solution until I solved it myself..just copy the path like this..don't use any other method.. solotion

anoneditor avatar Nov 21 '23 13:11 anoneditor

I get the same error. Standalone, latest version. I have the FFMPEG in the system path.

EDIT: This error only happens if you use model that has been trained with the 'model pitch guidance' set to FALSE. If you want to use that model, you have to set "Protect the artifact of voiceless consonant and breath. 0.5: don' use it. The number smaller, the stronger protection." to 0.5 - the error goes away.

I had this problem for a while, I looked everywhere but I didn't find a solution until I solved it myself..just copy the path like this..don't use any other method.. I had this problem for a while, I looked everywhere but I didn't find a solution until I solved it myself..just copy the path like this..don't use any other method.. Uploading solotion.png…

anoneditor avatar Nov 21 '23 13:11 anoneditor

I’ve had the same issue, with the dtype. I solved it by updating Python to 3.11. All issues gone!

bartvangogh avatar Jan 04 '24 11:01 bartvangogh

tnx bro i did this and its working fine for now 😃♥️

On Thu, Jan 4, 2024 at 2:49 PM bartvangogh @.***> wrote:

I’ve had the same issue, with the dtype. I solved it by updating Python to 3.11. All issues gone!

— Reply to this email directly, view it on GitHub https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/issues/529#issuecomment-1876928872, or unsubscribe https://github.com/notifications/unsubscribe-auth/BEE57GN3TZFLLFF5NUGUULDYM2F3JAVCNFSM6AAAAAAZG2DNGSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZWHEZDQOBXGI . You are receiving this because you commented.Message ID: <RVC-Project/Retrieval-based-Voice-Conversion-WebUI/issues/529/1876928872@ github.com>

anoneditor avatar Jan 05 '24 12:01 anoneditor

Hey, another person having problems with this same error... Info:

  • System: Windows 10
  • Python 3.10.11 (doesn't work with 3.11 onwards on Windows)
  • No supported GPU
  • Installed dependencies with requirements-dml.txt and Visual Studio Build Tools 2022

The wav file I was testing with was 16-bit, so that isn't the issue... Swapping out backslashes for slashes didn't work either :-\

It looks like there's an error with making the pipeline in vc/modules.py, based on this error from trying to pass a single file through the batch tab: image

SpiderBraider avatar Jan 19 '24 13:01 SpiderBraider

I had this problem for a while, I looked everywhere but I didn't find a solution until I solved it myself..just copy the path like this..don't use any other method.. solotion

Worked for me! Thanks. It gets a bit weird, though...

"C:\Users\hello\Desktop\FNM\Digging.wav.wav"

Funky-Synatra avatar Mar 31 '24 17:03 Funky-Synatra

Sometimes the same issue shows up again and I think it mistly occurs when the audio that needs to be converted is not on 44Khz, or when the audio has a silent start of more than 0.5 seconds.

bartvangogh avatar Mar 31 '24 22:03 bartvangogh

This issue was closed because it has been inactive for 15 days since being marked as stale.

github-actions[bot] avatar May 16 '24 04:05 github-actions[bot]