neural_sp icon indicating copy to clipboard operation
neural_sp copied to clipboard

about the bug when decoding streaming ASR

Open boji123 opened this issue 3 years ago • 5 comments

2020-08-17T03:05:45.568884032Z File "neural_sp/neural_sp/models/seq2seq/decoders/transformer.py", line 968, in beam_search 2020-08-17T03:05:45.568887299Z rightmost_frame = max(0, aws_last_success[0, :, 0].nonzero()[:, -1].max().item()) + 1 2020-08-17T03:05:45.568890475Z RuntimeError: invalid argument 1: tensor must have one dimension at /pytorch/aten/src/TH/generic/THTensorEvenMoreMath.cpp:590

I need assistance, really appreciate. After finish trainning your default streaming configs on aishell, I tried to decode the model and this error occurs.

boji123 avatar Aug 17 '20 03:08 boji123

config is conf/asr/transformer_mma/lc_transformer_mma_subsample8_ma4H_ca4H_chunk16_from4L_64_128_64.yaml

boji123 avatar Aug 17 '20 03:08 boji123

Code I call the decoder is local/score.sh \ --data data \ --model results/asr/train_sp/conv2Ltransformer256dmodel2048dff12L4Hpeadd_chunkL64C128R64_mask_max_pool8_transformer256dmodel2048dff6L4Hpe1dconv3Lmocha_ma4H_ca4H_w16_bias-2.0_share_from4Ldrophead0.5_noam_lr5.0_bs16_ls0.1_warmup25000_accum8_ctc0.3/model.epoch-25 \ --n_average 10 \ --beam_width 10 \ --lm_weight 0.3 \ --length_penalty 2.0 \ --mma_delay_threshold 8

boji123 avatar Aug 17 '20 03:08 boji123

@boji123 Can you check the size of aws_last_success when this happens? I could not reproduce this.

hirofumi0810 avatar Aug 19 '20 14:08 hirofumi0810

this error not always occurs. decoding can continue when I comment these logging codes

boji123 avatar Aug 20 '20 01:08 boji123

I also meet this error. To solve it, I just check the length before carry out "aws_last_success[0, :, 0].nonzero()[:, -1].max()". If it got 0, I set rightmost_frame to 0. But I think this is not resonable. If you have any other solution, please let me know. Thanks.

mlxu995 avatar Sep 12 '20 01:09 mlxu995