Skip to content

加载GPT sovit的训练模型时,管理员面板显示model loading failed #229

@ziyiTexas

Description

@ziyiTexas

2025-10-11 16:10:00 [INFO] Loading model vits_path: D:\project\AI Project\vits-simple-api\data\models\ZHANG/ZHANG_e8_s88.pth t2s_path: D:\project\AI Project\vits-simple-api\data\models\ZHANG/ZHANG-e15.ckpt [in views.load_model:97]
2025-10-11 16:10:00 [INFO] Loaded checkpoint 'D:\project\AI Project\vits-simple-api\data\models\ZHANG/ZHANG_e8_s88.pth' [in gpt_sovits.load_vits_weights:68]
2025-10-11 16:10:00 [INFO] Loading failed. Weights only load failed. 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.
Please file an issue with the following so that we can make weights_only=True compatible with your use case: WeightsUnpickler error: Unsupported operand 48

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. [in ModelManager.load_model:357]
2025-10-11 16:10:00 [ERROR] Traceback (most recent call last):
File "D:\project\AI Project\vits-simple-api\manager\ModelManager.py", line 338, in load_model
model_data = self._load_model_from_path(tts_model)
File "D:\project\AI Project\vits-simple-api\manager\ModelManager.py", line 301, in _load_model_from_path
model.load_model(self.model_handler)
File "D:\project\AI Project\vits-simple-api\gpt_sovits\gpt_sovits.py", line 56, in load_model
self.load_vits_weights(self.vits_path)
File "D:\project\AI Project\vits-simple-api\gpt_sovits\gpt_sovits.py", line 69, in load_vits_weights
dict_s2 = torch.load(weight_path, map_location=self.device)
File "T:\anaconda3\envs\GPTSoVits\lib\site-packages\torch\serialization.py", line 1548, in load
raise pickle.UnpicklingError(_get_wo_message(str(e))) from None
_pickle.UnpicklingError: Weights only load failed. 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.
Please file an issue with the following so that we can make weights_only=True compatible with your use case: WeightsUnpickler error: Unsupported operand 48

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.
[in ModelManager.load_model:358]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions