RVC-Boss / GPT-SoVITS

1 min voice data can also be used to train a good TTS model! (few shot voice cloning)
MIT License
35.82k stars 4.09k forks source link

api_v2.py 启动报错-HPU device module is not loaded #1647

Open njzfw1024 opened 1 month ago

njzfw1024 commented 1 month ago

启动命令: python api_v2.py -a 0.0.0.0 -p 7860 -c GPT_SoVITS/configs/tts_infer.yaml

tts_infer.yaml:

custom: bert_base_path: GPT_SoVITS/pretrained_models/chinese-roberta-wwm-ext-large cnhuhbert_base_path: GPT_SoVITS/pretrained_models/chinese-hubert-base device: gpu is_half: false t2s_weights_path: GPT_SoVITS/pretrained_models/gsv-v2final-pretrained/s1bert25hz-5kh-longer-epoch=12-step=369668.ckpt version: v2 vits_weights_path: GPT_SoVITS/pretrained_models/gsv-v2final-pretrained/s2G2333k.pth

报错信息:

Loading Text2Semantic weights from GPT_SoVITS/pretrained_models/gsv-v2final-pretrained/s1bert25hz-5kh-longer-epoch=12-step=369668.ckpt Traceback (most recent call last): File "/mnt/zfw/GPT-SoVITS/api_v2.py", line 143, in <module> tts_pipeline = TTS(tts_config) File "/mnt/zfw/GPT-SoVITS/GPT_SoVITS/TTS_infer_pack/TTS.py", line 252, in __init__ self._init_models() File "/mnt/zfw/GPT-SoVITS/GPT_SoVITS/TTS_infer_pack/TTS.py", line 277, in _init_models self.init_t2s_weights(self.configs.t2s_weights_path) File "/mnt/zfw/GPT-SoVITS/GPT_SoVITS/TTS_infer_pack/TTS.py", line 347, in init_t2s_weights dict_s1 = torch.load(weights_path, map_location=self.configs.device) File "/root/anaconda3/envs/GPTSoVits/lib/python3.9/site-packages/torch/serialization.py", line 1014, in load return _load(opened_zipfile, File "/root/anaconda3/envs/GPTSoVits/lib/python3.9/site-packages/torch/serialization.py", line 1422, in _load result = unpickler.load() File "/root/anaconda3/envs/GPTSoVits/lib/python3.9/site-packages/torch/serialization.py", line 1392, in persistent_load typed_storage = load_tensor(dtype, nbytes, key, _maybe_decode_ascii(location)) File "/root/anaconda3/envs/GPTSoVits/lib/python3.9/site-packages/torch/serialization.py", line 1366, in load_tensor wrap_storage=restore_location(storage, location), File "/root/anaconda3/envs/GPTSoVits/lib/python3.9/site-packages/torch/serialization.py", line 1296, in restore_location return default_restore_location(storage, map_location) File "/root/anaconda3/envs/GPTSoVits/lib/python3.9/site-packages/torch/serialization.py", line 381, in default_restore_location result = fn(storage, location) File "/root/anaconda3/envs/GPTSoVits/lib/python3.9/site-packages/torch/serialization.py", line 304, in _hpu_deserialize assert hpu is not None, "HPU device module is not loaded" AssertionError: HPU device module is not loaded

luxiongx commented 1 month ago

GPT-SoVITS/GPT_SoVITS/TTS_infer_pack/TTS.py 修改

   self.device = self.configs.get("device", torch.device("cuda" if torch.cuda.is_available() else "cpu"))