sherpa-onnx
sherpa-onnx copied to clipboard
export 3d speaker campplus sv model to onnx error
infer_sv.py from speakerlib(3dspeaker) and modify damo/speech_campplus_sv_zh-cn_16k-common to iic/speech_campplus_sv_zh-cn_16k-common
but some errors:
root@6e7e8c0b451c:~/3D-Speaker/sv_onnx# python export-onnx.py --model speech_campplus_sv_zh-cn_16k-common 2024-03-04 15:11:25,379 - modelscope - INFO - PyTorch version 2.0.1+cpu Found. 2024-03-04 15:11:25,386 - modelscope - INFO - TensorFlow version 2.13.0 Found. 2024-03-04 15:11:25,387 - modelscope - INFO - Loading ast index from /mnt/workspace/.cache/modelscope/ast_indexer 2024-03-04 15:11:25,457 - modelscope - INFO - Loading done! Current index file version is 1.9.5, with md5 79827826d04c54fc06982662c5095533 and a total number of 945 components indexed 2024-03-04 15:11:26,846 - modelscope - INFO - Use user-specified model revision: v2.0.0 {'framework': 'pytorch', 'task': 'speaker-verification', 'model_config': 'config.yaml', 'model_file': 'campplus_cn_common.bin', 'model': {'type': 'cam++-sv', 'model_config': {'sample_rate': 16000, 'fbank_dim': 80, 'emb_size': 192}, 'pretrained_model': 'campplus_cn_common.bin', 'yesOrno_thr': 0.31}, 'pipeline': {'type': 'speaker-verification'}} /opt/conda/lib/python3.8/site-packages/torch/onnx/utils.py:2029: UserWarning: Provided key embeddings for dynamic axes is not a valid input/output name warnings.warn( ============== Diagnostic Run torch.onnx.export version 2.0.1+cpu ============== verbose: False, log level: Level.ERROR ======================= 0 NONE 0 NOTE 0 WARNING 0 ERROR ========================
Traceback (most recent call last):
File "export-onnx.py", line 149, in
Inputs:
#0: 1021 defined in (%1021 : Float(*, 128, *, strides=[6400, 50, 1], requires_grad=0, device=cpu) = onnx::Relu(%input.107), scope: speakerlab.models.campplus.DTDNN.CAMPPlus::/torch.nn.modules.container.Sequential::xvector/speakerlab.models.campplus.layers.CAMDenseTDNNBlock::block1/speakerlab.models.campplus.layers.CAMDenseTDNNLayer::tdnnd1/torch.nn.modules.container.Sequential::nonlinear2/torch.nn.modules.activation.ReLU::relu # /opt/conda/lib/python3.8/site-packages/torch/nn/functional.py:1455:0
) (type 'Tensor')
#1: 1026 defined in (%1026 : Long(6, strides=[1], device=cpu) = onnx::Constant[value= 0 0 0 0 0 0 [ CPULongType{6} ]](), scope: speakerlab.models.campplus.DTDNN.CAMPPlus::/torch.nn.modules.container.Sequential::xvector/speakerlab.models.campplus.layers.CAMDenseTDNNBlock::block1/speakerlab.models.campplus.layers.CAMDenseTDNNLayer::tdnnd1/speakerlab.models.campplus.layers.CAMLayer::cam_layer
) (type 'Tensor')
Outputs:
#0: 1027 defined in (%1027 : Float(*, 128, *, device=cpu) = onnx::Pad[mode="constant"](%1021, %1026), scope: speakerlab.models.campplus.DTDNN.CAMPPlus::/torch.nn.modules.container.Sequential::xvector/speakerlab.models.campplus.layers.CAMDenseTDNNBlock::block1/speakerlab.models.campplus.layers.CAMDenseTDNNLayer::tdnnd1/speakerlab.models.campplus.layers.CAMLayer::cam_layer
) (type 'Tensor')
I found this onnx model on release, but i want to train this model with my data. Looking forward to a reply. Thank you