mac m4 中进行推理出现错误AttributeError: 'NoneType' object has no attribute 'tobytes'
2025-04-12 01:07:51 | WARNING | infer.modules.vc.modules | Traceback (most recent call last):
File "/Users/lvxiaodong/Desktop/RVC/Retrieval-based-Voice-Conversion-WebUI/infer/modules/vc/modules.py", line 172, in vc_single
self.hubert_model = load_hubert(self.config)
File "/Users/lvxiaodong/Desktop/RVC/Retrieval-based-Voice-Conversion-WebUI/infer/modules/vc/utils.py", line 23, in load_hubert
models, _, _ = checkpoint_utils.load_model_ensemble_and_task(
File "/opt/miniconda3/lib/python3.9/site-packages/fairseq/checkpoint_utils.py", line 425, in load_model_ensemble_and_task
state = load_checkpoint_to_cpu(filename, arg_overrides)
File "/opt/miniconda3/lib/python3.9/site-packages/fairseq/checkpoint_utils.py", line 315, in load_checkpoint_to_cpu
state = torch.load(f, map_location=torch.device("cpu"))
File "/opt/miniconda3/lib/python3.9/site-packages/torch/serialization.py", line 1470, in load
raise pickle.UnpicklingError(_get_wo_message(str(e))) from None
_pickle.UnpicklingError: Weights only load failed. This file can still be loaded, to do so you have two options, do those steps only if you trust the source of the checkpoint.
(1) In PyTorch 2.6, we changed the default value of the weights_only argument in torch.load from False to True. Re-running torch.load with weights_only set to False will likely succeed, but it can result in arbitrary code execution. Do it only if you got the file from a trusted source.
(2) Alternatively, to load with weights_only=True please check the recommended steps in the following error message.
WeightsUnpickler error: Unsupported global: GLOBAL fairseq.data.dictionary.Dictionary was not an allowed global by default. Please use torch.serialization.add_safe_globals([Dictionary]) or the torch.serialization.safe_globals([Dictionary]) context manager to allowlist this global if you trust this class/function.
Check the documentation of torch.load to learn more about types accepted by default with weights_only https://pytorch.org/docs/stable/generated/torch.load.html.
Traceback (most recent call last): File "/opt/miniconda3/lib/python3.9/site-packages/gradio/queueing.py", line 407, in call_prediction output = await route_utils.call_process_api( File "/opt/miniconda3/lib/python3.9/site-packages/gradio/route_utils.py", line 226, in call_process_api output = await app.get_blocks().process_api( File "/opt/miniconda3/lib/python3.9/site-packages/gradio/blocks.py", line 1559, in process_api data = self.postprocess_data(fn_index, result["prediction"], state) File "/opt/miniconda3/lib/python3.9/site-packages/gradio/blocks.py", line 1447, in postprocess_data prediction_value = block.postprocess(prediction_value) File "/opt/miniconda3/lib/python3.9/site-packages/gradio/components/audio.py", line 341, in postprocess file_path = self.audio_to_temp_file( File "/opt/miniconda3/lib/python3.9/site-packages/gradio/components/base.py", line 336, in audio_to_temp_file temp_dir = Path(self.DEFAULT_TEMP_DIR) / self.hash_bytes(data.tobytes()) AttributeError: 'NoneType' object has no attribute 'tobytes'
尝试很多方法无法正确运行!!!
这个不清楚跟处理器架构有没有关系,我是m1,在虚拟机装win也试过了也是报一样的错误,换win笔记本才能运行
用的是macbook还是macmini?用的是cpu还是gpu。