hirofumi0810 / neural_sp

End-to-end ASR/LM implementation with PyTorch
Apache License 2.0
594 stars 140 forks source link

The function eval_wordpiece in asr/eval.py doesn't support keyword argument 'teacher_force' #210

Closed lijianhackthon closed 3 years ago

lijianhackthon commented 3 years ago

Hi @hirofumi0810 , thanks for your great work.

I'm now trying the csj example. I've passed the training phase using the run.sh script and got the model successfully. The conf file that I'm using is the default conf/asr/blstm_las.yaml.

When I tried the local/score.sh for evaluation, I got an error that says TypeError: eval_wordpiece() got an unexpected keyword argument 'teacher_force'. Here is the whole output,

Original utterance num: 1272
Removed 0 empty utterances
Traceback (most recent call last):
  File "/home/lijian/workspace/github-repos/neural_sp/examples/csj/s5/../../../neural_sp/bin/asr/eval.py", line 240, in <module>
    main()
  File "/home/lijian/workspace/github-repos/neural_sp/examples/csj/s5/../../../neural_sp/bin/asr/eval.py", line 180, in main
    teacher_force=len(args.recog_word_alignments) > 0)
TypeError: eval_wordpiece() got an unexpected keyword argument 'teacher_force'

In https://github.com/hirofumi0810/neural_sp/blob/master/neural_sp/bin/asr/eval.py#L180 , it calls eval_wordpiece() with a keyword argument teacher_force. But it seems that the eval_wordpiece function defined here doesn't support this keyword argument. The code that I'm using is from the master branch (commit hash 7a9ec231d50a9ed6a0457a6c582526173c8ceb6b).

Could you please take a look of this? Thanks.

hirofumi0810 commented 3 years ago

@lijianhackthon Thank you. This is indeed a bug. I'll fix by tomorrow and add some test codes for inference.