1
0
mirror of https://github.com/fumiama/Retrieval-based-Voice-Conversion-WebUI.git synced 2026-06-06 01:30:24 +08:00

FIx Onnx export (#1963)

* Add files via upload

* Add files via upload

* Add files via upload
This commit is contained in:
Ναρουσέ·μ·γιουμεμί·Χινακάννα
2024-04-14 13:55:15 +08:00
committed by GitHub
parent 9cae044bf2
commit 597e0a97d0
3 changed files with 173 additions and 119 deletions

View File

@@ -18,7 +18,7 @@ def export_onnx(ModelPath, ExportedPath):
device = "cpu" # 导出时设备(不影响使用模型)
net_g = SynthesizerTrnMsNSFsidM(
*cpt["config"], is_half=False, version=cpt.get("version", "v1")
*cpt["config"], is_half=False, encoder_dim=vec_channels
) # fp32导出C++要支持fp16必须手动将内存重新排列所以暂时不用fp16
net_g.load_state_dict(cpt["weight"], strict=False)
input_names = ["phone", "phone_lengths", "pitch", "pitchf", "ds", "rnd"]
@@ -44,8 +44,8 @@ def export_onnx(ModelPath, ExportedPath):
"rnd": [2],
},
do_constant_folding=False,
opset_version=13,
verbose=False,
opset_version=18,
verbose=True,
input_names=input_names,
output_names=output_names,
)