Open Xwmiss opened 1 year ago
应该是paddle在动转静的时候,输入出现了问题?
https://github.com/PaddlePaddle/PaddleSpeech/issues/2826 @yt605155624 看到了此前的问题,看来paddle上面的vits还是不支持导出onnx。 但是奇怪的在于,哪怕是最后转成onnx不能成功,但是当我使用动转静的时候,也是出现上面一样的错误。。。
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
General Question
在导出vits-csmsc的onnx模型时出现问题,使用的代码如下
import argparse from pathlib import Path
import paddle import soundfile as sf import yaml from timer import timer from yacs.config import CfgNode from paddle.static import InputSpec import os
from paddle import jit from paddlespeech.t2s.models.vits import VITS from paddlespeech.t2s.models.vits import VITSInference from paddlespeech.t2s.utils import str2bool
paddle.set_device("cpu")
config = "/home/cw/code/tts/PaddleSpeech/checkpoint/vits_csmsc_ckpt_1.4.0/default.yaml" ckpt = "/home/cw/code/tts/PaddleSpeech/checkpoint/vits_csmsc_ckpt_1.4.0/snapshot_iter_150000.pdz" phones_dict = ( "/home/cw/code/tts/PaddleSpeech/checkpoint/vits_csmsc_ckpt_1.4.0/phone_id_map.txt" )
with open(config) as f: config = CfgNode(yaml.safe_load(f))
save_path = "/home/cw/code/tts/PaddleSpeech/rknn_test/test.onnx" # 需要保存的路径 x_spec = paddle.static.InputSpec( [50], "int64", "phone_ids" ) # 为模型指定输入的形状和数据类型,支持持 Tensor 或 InputSpec ,InputSpec 支持动态的 shape。 paddle.onnx.export(vits_inference, save_path, input_spec=[x_spec], opset_version=12)`
报错结果如下: