› Forums › Automatic speech recognition › HTK › Using -A argument
- This topic has 5 replies, 3 voices, and was last updated 9 months ago by Simon.
-
AuthorPosts
-
-
December 5, 2020 at 11:38 #13411
I’m trying to catch errors when HTK fails – I’ve seen your (Simon’s) combine_mlfs.sh script & how it does this. However, I’m trying to catch errors to know exactly which user is failing when running some HTK script, while using the -S option. I see that one way to access command line arguments in HTK is the -A option, but I can’t see any guidqnce as to how to actually use this argument? I just want to take the arguments that HInit has (e.g. ‘WORD’, ‘USER’ etc.) and write the USER argument to a bad_users script.
-
December 5, 2020 at 11:57 #13412
In Unix (and Linux) type operating systems, when process finishes, it exits with a status. This is 0 for success and some other number if there was an error. This status is available immediately afterwards in the shell variable
$?
and here is how you might test that:HInit -T 0 \ -G ESPS \ -m 1 \ -C resources/CONFIG \ -l $WORD \ -M models/hmm0 \ -o $WORD \ -L ${DATA}/lab/train \ -S ${SCRIPT_FILE} \ models/proto/$PROTO if [ $? -ne 0 ] then echo "HInit failed for script file "${SCRIPT_FILE} exit 1 fi
The command
exit 1
means that this script will immediately exit with status 1, which you could detect in the script that called it – so, you can propagate the error back up to the top-level script (e.g.,do_experiments
). -
November 21, 2023 at 12:34 #17219
I’m implementing Simon’s suggestion for catching run errors. I can’t get this to work in the
recognise
script when I run a dependent_speaker model forpanagiot
. Here’s the error associated withpanagiot
:File: /Volumes/Network/courses/sp/data/mfcc/test/panagiot_test.3.mfcc six == [80 frames] -75.6707 [Ac=-6053.7 LM=0.0] (Act=22.7) ERROR [+6510] LOpen: Unable to open label file rec/panagiot_test.2.lab FATAL ERROR - Terminating program HResults (standard_in) 2: syntax error
And here are the lines that are trying to catch the error, unsuccessfully:
HVite -T 1 -C resources/CONFIG \ -d models/hmm1 \ -l rec \ -w resources/grammar_as_network \ resources/dictionary \ resources/word_list \ ${F} if [ $? -ne 0 ] then echo "HVite failed for user "${USER} exit 1 fi done
Grateful for suggestions!
-
November 21, 2023 at 13:05 #17220
Your error is occurring with
HResults
, notHVite
:FATAL ERROR - Terminating program HResults
-
November 21, 2023 at 13:27 #17221
Thanks, Simon. Oops – here is the code I have under HResults:
HResults -p \ -I ${DATA}/lab/test/${USER}_test.mlf \ resources/word_list \ rec/${USER}_test?(_)??.rec if [ $? -ne 0 ] then echo "HResults failed for user "${USER} exit 1 fi
-
-
November 21, 2023 at 14:02 #17222
The error
Unable to open label file rec/panagiot_test.2.lab
tells us that
HResults
cannot find the.lab
file (which contains the correct label) corresponding to the recognition result stored in the file inrec/panagiot_test.2.rec
HResults
is looking for that.lab
file in therec
directory. But this is because it did not find it within the MLF (multiple label file)panagiot_test.mlf
– perhaps this file is missing from that user’s data?The error
(standard_in) 2: syntax error
occurs later – so debug that next…
-
-
AuthorPosts
- You must be logged in to reply to this topic.