HTK Extractor Bug

33 views
Skip to first unread message

Ananay Wadehra

unread,
Mar 15, 2021, 8:32:40 AM3/15/21
to bob-devel
While running bob spear tookit, the MFCC extractor worked completely fine however the HTK extractor gave an error :

bob.bio.base@2021-03-15 17:16:38,040 -- ERROR: During the execution, an exception was raised: name 'hkt_file' is not defined
Traceback (most recent call last):
  File "/home/aw/miniconda3/envs/biom/bin/verify.py", line 11, in <module>
    sys.exit(main())
  File "/home/aw/miniconda3/envs/biom/lib/python3.7/site-packages/bob/bio/base/script/verify.py", line 435, in main
    verify(args, command_line_parameters)
  File "/home/aw/miniconda3/envs/biom/lib/python3.7/site-packages/bob/bio/base/script/verify.py", line 415, in verify
    if not execute(args):
  File "/home/aw/miniconda3/envs/biom/lib/python3.7/site-packages/bob/bio/base/script/verify.py", line 282, in execute
    force = args.force)
  File "/home/aw/miniconda3/envs/biom/lib/python3.7/site-packages/bob/bio/base/tools/extractor.py", line 130, in extract
    feature = extractor(data)
  File "/home/aw/miniconda3/envs/biom/lib/python3.7/site-packages/bob/bio/spear/extractor/HTKFeatures.py", line 83, in __call__
    cepstral_features=self.HTKReader(hkt_file)
NameError: name 'hkt_file' is not defined


By going to the file HTKFeatures.py and changing the typo in line 83 [hkt_file to htk_file], I encountered another error

bob.bio.base@2021-03-15 17:57:08,271 -- ERROR: During the execution, an exception was raised: [Errno 9] Bad file descriptor
Traceback (most recent call last):
  File "/home/aw/miniconda3/envs/biom/bin/verify.py", line 11, in <module>
    sys.exit(main())
  File "/home/aw/miniconda3/envs/biom/lib/python3.7/site-packages/bob/bio/base/script/verify.py", line 435, in main
    verify(args, command_line_parameters)
  File "/home/aw/miniconda3/envs/biom/lib/python3.7/site-packages/bob/bio/base/script/verify.py", line 415, in verify
    if not execute(args):
  File "/home/aw/miniconda3/envs/biom/lib/python3.7/site-packages/bob/bio/base/script/verify.py", line 282, in execute
    force = args.force)
  File "/home/aw/miniconda3/envs/biom/lib/python3.7/site-packages/bob/bio/base/tools/extractor.py", line 130, in extract
    feature = extractor(data)
  File "/home/aw/miniconda3/envs/biom/lib/python3.7/site-packages/bob/bio/spear/extractor/HTKFeatures.py", line 84, in __call__
    cepstral_features=self.HTKReader(htk_file)
  File "/home/aw/miniconda3/envs/biom/lib/python3.7/site-packages/bob/bio/spear/extractor/HTKFeatures.py", line 67, in HTKReader
    with open(input_file, 'r') as fid:
OSError: [Errno 9] Bad file descriptor

Do you guys have any idea how to mend this error, I think it has to do with the fact of opening the htk_file, even though it has only data[0] value in it?

I ran 'verify.py  -d voxforge -p energy-2gauss -e htk -a gmm-voxforge -s ubm_gmm --groups {dev,eval}' the following' command in the terminal
Reply all
Reply to author
Forward
0 new messages