AttributeError: 'NoneType' object has no attribute 'pipeline'
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
I had the same problem.
And did you manage to fix it?
+1 hope a solution
I have the same exact issue on my mac.
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
any news on this? Bug still persist, having the same issue. Tried a lot of things without success.
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 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?
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.
- 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.
- 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.
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.
- 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.
- 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 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
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.
solution:
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
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.
Hello, today I meet this problem, and it is my solution:
- 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'
-
you can found that it is the gradio problem
-
reinstall correct gradio, i install gradio==3.34.0 in https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/main/requirements.txt
-
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]
-
search in internet, get result https://github.com/gradio-app/gradio/issues/6914
-
run the code
pip install gradio==3.50.2
- success fix this