InvalidArgumentError when using do_single_file_inference()

hi all,

I was trying to use:

do_single_file_inference() from DeepSpeech.py

like

do_single_file_inference('audio/4507-16021-0012.wav')

but I got an error like:

What I don’t really understand is: InvalidArgumentError: Shapes of all inputs must match: values[0].shape = [1,30] != values[1].shape = [1,31]

what is happening here?

Did you use the command line argument --one_shot_infer when you called DeepSpeech.py on the command line?

The function depends on the values of the DeepSpeech.py command line flags, in particular the --checkpoint_dir flag. If you’re calling the function directly, you need to make sure you’re setting up the environment first.

As Kelly already said, you could also just use the --one_shot_infer flag.