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 'pipeline'

Open kevin-guimard-ext opened this issue 2 years ago • 15 comments

Hello,

I ran the GUI and, in inference mode, selected an index file of a pretrained model and the path of the audio file to be processed. But I run into the following error:

2023-10-19 09:33:29 | WARNING | infer.modules.vc.modules | Traceback (most recent call last):
  File "/home/jupyter/Retrieval-based-Voice-Conversion-WebUI/infer/modules/vc/modules.py", line 185, in vc_single
    audio_opt = self.pipeline.pipeline(
AttributeError: 'NoneType' object has no attribute 'pipeline'

Traceback (most recent call last):
  File "/opt/conda/lib/python3.10/site-packages/gradio/routes.py", line 437, in run_predict
    output = await app.get_blocks().process_api(
  File "/opt/conda/lib/python3.10/site-packages/gradio/blocks.py", line 1349, in process_api
    data = self.postprocess_data(fn_index, result["prediction"], state)
  File "/opt/conda/lib/python3.10/site-packages/gradio/blocks.py", line 1283, in postprocess_data
    prediction_value = block.postprocess(prediction_value)
  File "/opt/conda/lib/python3.10/site-packages/gradio/components.py", line 2586, in postprocess
    file_path = self.audio_to_temp_file(
  File "/opt/conda/lib/python3.10/site-packages/gradio/components.py", line 360, in audio_to_temp_file
    temp_dir = Path(dir) / self.hash_bytes(data.tobytes())
AttributeError: 'NoneType' object has no attribute 'tobytes'```

Another question, don't I have to input a pth file also?

Thanks,
Kevin

kevin-guimard-ext avatar Oct 19 '23 09:10 kevin-guimard-ext

I had the same problem.

Misaka-Mikodo avatar Oct 28 '23 09:10 Misaka-Mikodo

And did you manage to fix it?

marshalleq avatar Dec 14 '23 07:12 marshalleq

+1 hope a solution

OmangoItai avatar Feb 01 '24 22:02 OmangoItai

I have the same exact issue on my mac.

faustofonseca avatar Mar 17 '24 10:03 faustofonseca

Yes, it's strange bug. Sometimes I also saw that error, in that case I choose one standard model and convert one mp3 file, after that choose back custom model and it begin work fine without error... until I restart RVC server

Tessory avatar Mar 24 '24 05:03 Tessory

any news on this? Bug still persist, having the same issue. Tried a lot of things without success.

PJaekel93 avatar Apr 24 '24 09:04 PJaekel93

I guess it's because the program cannot parse non-windows file paths. I checked similar error analysis articles, which mentioned this. I encountered the same error under Linux, but everything was normal under Windows.

Tr-AIL avatar May 09 '24 09:05 Tr-AIL

@Tr-AIL thats an interesting point. But would that mean that no one actually made this work on Mac or Linux? I always assumed since the tutorial talks about Mac. Or do you mean the paths that we provide in the UI?

faustofonseca avatar May 09 '24 10:05 faustofonseca

thanks for replying. I managed to find a solution for myself and got it running, it might have had multiple reasons. The error originates from a problem where an asset is not correctly loaded.

  1. Wrong file paths: indeed in one of the earlier versions the filepath was wrong. It was fixed in a later update and should work now.
  2. Fault on my side, wrong use of the program. I did not run the full train, so the dropdown to chose a voice was empty. If any asset that is needed is empty it might throw the above mentioned error.

PJaekel93 avatar May 09 '24 10:05 PJaekel93

Oh, nice. Thank you for sharing!

On Thu, 9 May 2024 at 11:22, Patrik Jäkel @.***> wrote:

thanks for replying. I managed to find a solution for myself and got it running, it might have had multiple reasons. The error originates from a problem where an asset is not correctly loaded.

  1. Wrong file paths: indeed in one of the earlier versions the filepath was wrong. It was fixed in a later update and should work now.
  2. Fault on my side, wrong use of the program. I did not run the full train, so the dropdown to chose a voice was empty. If any asset that is needed is empty it might throw the above mentioned error.

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

faustofonseca avatar May 09 '24 10:05 faustofonseca

@faustofonseca theres an asset that detects the used system. So it should work in all systems in theory, it might occur that this is not correctly set and you get the problems with file paths. A general issue with that was fixed in commit fb16ba36b9d867d8551e6255bee39086ae4ab348 see Issue #2011

PJaekel93 avatar May 09 '24 10:05 PJaekel93

Make sure that the .pth model file is placed into assets/weights/<NAME>.pth, and .index model file is logs/<NAME>/added_<...>.index Notice that .pth file name and folder name in logs are the same.

artemious3 avatar May 18 '24 18:05 artemious3

solution:

image

image

2024-07-19 17:06:03 | INFO | infer.modules.vc.modules | Loading: assets/weights/mi-test.pth 2024-07-19 17:06:04 | INFO | infer.modules.vc.modules | Select index: logs/mi-test/added_IVF1043_Flat_nprobe_1_mi-test_v2.index 2024-07-19 17:06:44 | INFO | infer.modules.vc.pipeline | Loading rmvpe model,assets/rmvpe/rmvpe.pt

sankexin avatar Jul 19 '24 09:07 sankexin

Reinstalling the exact packages in the requirements.txt fixed it on my end :

pip install -r requirements.txt

Some versions had mismatches and caused these weird types of incompatibility glitches.

chuksum avatar Aug 08 '24 19:08 chuksum

Hello, today I meet this problem, and it is my solution:

  1. see error code:
  File "C:\ai\lib\site-packages\gradio\queueing.py", line 745, in process_events
    response = await route_utils.call_process_api(
  File "C:\ai\lib\site-packages\gradio\route_utils.py", line 354, in call_process_api
    output = await app.get_blocks().process_api(
  File "C:\ai\lib\site-packages\gradio\blocks.py", line 2127, in process_api
    data = await self.postprocess_data(block_fn, result["prediction"], state)
  File "C:\ai\lib\site-packages\gradio\blocks.py", line 1904, in postprocess_data
    prediction_value = block.postprocess(prediction_value)
  File "C:\ai\lib\site-packages\gradio\components\audio.py", line 316, in postprocess
    file_path = processing_utils.save_audio_to_cache(
  File "C:\ai\lib\site-packages\gradio\processing_utils.py", line 182, in save_audio_to_cache
    temp_dir = Path(cache_dir) / hash_bytes(data.tobytes())
AttributeError: 'NoneType' object has no attribute 'tobytes'
  1. you can found that it is the gradio problem

  2. reinstall correct gradio, i install gradio==3.34.0 in https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/main/requirements.txt

  3. find more problem: (maybe you will not meet this problem, my some package version is different with requirements.txt, because i want to use this env for other projects, so please check the solution above, if not work, continue to below.)

pydantic_core._pydantic_core.ValidationError: 1 validation error for PredictBody event_id Field required [type=missing, input_value={'data': ['describe this ...on_hash': 'ncvk1jrssin'}, input_type=dict] 
  1. search in internet, get result https://github.com/gradio-app/gradio/issues/6914

  2. run the code

pip install gradio==3.50.2
  1. success fix this

wayne931121 avatar Sep 30 '25 14:09 wayne931121