MontrealCorpusTools / Montreal-Forced-Aligner

Command line utility for forced alignment using Kaldi
https://montrealcorpustools.github.io/Montreal-Forced-Aligner/
MIT License
1.27k stars 242 forks source link

[BUG] FeatureGenerationError on soundfiles #701

Closed cbeaumard closed 5 months ago

cbeaumard commented 10 months ago

Debugging checklist

[x] Have you updated to latest MFA version? Yes [x] Have you tried rerunning the command with the --clean flag? Yes

Describe the issue I want to generate TextGrids from my own soundfiles (I don't have textfiles for them). No problem when using the mfa validate command.

For Reproducing your issue Please fill out the following:

  1. Corpus structure
    • What language is the corpus in? French
    • How many files/speakers? 18/3
    • Are you using lab files or TextGrid files for input? None
  2. Dictionary
    • Are you using a dictionary from MFA? If so, which one? french_mfa
    • If it's a custom dictionary, what is the phoneset?
  3. Acoustic model
    • If you're using an acoustic model, is it one download through MFA? If so, which one? french_mfa
    • If it's a model you've trained, what data was it trained on?

Log file INFO Generating final features...
0% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0/18 [ 0:00:01 < -:--:-- , ? it/s ] ERROR There was an error in the run, please see the log.
Exception ignored in atexit callback: <bound method ExitHooks.history_save_handler of <montreal_forced_aligner.command_line.mfa.ExitHooks object at 0x7f984d21a910>> Traceback (most recent call last): File "/home/cbeaumard/miniconda3/envs/aligner/lib/python3.11/site-packages/montreal_forced_aligner/command_line/mfa.py", line 100, in history_save_handler raise self.exception File "/home/cbeaumard/miniconda3/envs/aligner/bin/mfa", line 10, in sys.exit(mfa_cli()) ^^^^^^^^^ File "/home/cbeaumard/miniconda3/envs/aligner/lib/python3.11/site-packages/click/core.py", line 1157, in call return self.main(*args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/cbeaumard/miniconda3/envs/aligner/lib/python3.11/site-packages/rich_click/rich_group.py", line 21, in main rv = super().main(args, standalone_mode=False, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/cbeaumard/miniconda3/envs/aligner/lib/python3.11/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/home/cbeaumard/miniconda3/envs/aligner/lib/python3.11/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/cbeaumard/miniconda3/envs/aligner/lib/python3.11/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/cbeaumard/miniconda3/envs/aligner/lib/python3.11/site-packages/click/core.py", line 783, in invoke return __callback(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/cbeaumard/miniconda3/envs/aligner/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func return f(get_current_context(), *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/cbeaumard/miniconda3/envs/aligner/lib/python3.11/site-packages/montreal_forced_aligner/command_line/align.py", line 111, in align_corpus_cli aligner.align() File "/home/cbeaumard/miniconda3/envs/aligner/lib/python3.11/site-packages/montreal_forced_aligner/alignment/pretrained.py", line 333, in align self.setup() File "/home/cbeaumard/miniconda3/envs/aligner/lib/python3.11/site-packages/montreal_forced_aligner/alignment/pretrained.py", line 207, in setup self.load_corpus() File "/home/cbeaumard/miniconda3/envs/aligner/lib/python3.11/site-packages/montreal_forced_aligner/corpus/acoustic_corpus.py", line 1082, in load_corpus self.generate_features() File "/home/cbeaumard/miniconda3/envs/aligner/lib/python3.11/site-packages/montreal_forced_aligner/corpus/acoustic_corpus.py", line 512, in generate_features self.generate_final_features() File "/home/cbeaumard/miniconda3/envs/aligner/lib/python3.11/site-packages/montreal_forced_aligner/corpus/acoustic_corpus.py", line 459, in generate_final_features raise FeatureGenerationError( montreal_forced_aligner.exceptions.FeatureGenerationError: FeatureGenerationError:

No utterances had features, please check the logs for errors.

Desktop (please complete the following information):

Additional information MFA was installed with conda.

delale commented 10 months ago

Also have the same error

mmcauliffe commented 10 months ago

Are there any errors listed in the make_mfcc.X.log, generate_final_features.X.log, or cmvn.log files in ~/Documents/MFA/{corpus_name}/{corpus_name}/splitX/log (replacing {corpus_name} with your dataset name and X with the number of jobs)?

This is likely a bug in 3.0.X only, so if you need a workable version asap, installing the stable 2.2 via https://montreal-forced-aligner.readthedocs.io/en/latest/installation.html#installing-older-versions-of-mfa should unblock you.

delale commented 10 months ago

@mmcauliffe Can confirm that this is solved when moving to 2.2.17, so most likely a bug in 3.0.X. Thank you for the quick response.

ZhikangNiu commented 10 months ago

I also meet this bug, version is 3.0.X alpha 6:

mfa align /scratch/v-zhikangniu/LibriSpeech english_us_mfa english_mfa /data/v-zhikangniu/algner --clean
Please be aware that you are running an alpha version of MFA. If you would like to install a more stable version, please visit https://montreal-forced-aligner.readthedocs.io/en/latest/installation.html#installing-older-versions-of-mfa
 INFO     Setting up corpus information...                                                                                                                               
 INFO     Loading corpus from source files...                                                                                                                            
 100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 433,343/100  [ 0:00:00 < 0:00:00 , 2,383 it/s ]
 INFO     Found 5831 speakers across 433343 files, average number of utterances per speaker: 74.31709826787858                                                           
 INFO     Initializing multiprocessing jobs...                                                                                                                           
 INFO     Normalizing text...                                                                                                                                            
   0% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0/433,343  [ 0:00:02 < -:--:-- , ? it/s ]
 INFO     Generating MFCCs...                                                                                                                                            
   0% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0/433,343  [ 0:00:02 < -:--:-- , ? it/s ]
 INFO     Calculating CMVN...                                                                                                                                            
 INFO     Generating final features...                                                                                                                                   
   0% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0/433,343  [ 0:00:02 < -:--:-- , ? it/s ]
 ERROR    There was an error in the run, please see the log.                                                                                                             
Exception ignored in atexit callback: <bound method ExitHooks.history_save_handler of <montreal_forced_aligner.command_line.mfa.ExitHooks object at 0x7fbf16508dd0>>
Traceback (most recent call last):
  File "/anaconda/envs/aligner/lib/python3.11/site-packages/montreal_forced_aligner/command_line/mfa.py", line 107, in history_save_handler
    raise self.exception
  File "/anaconda/envs/aligner/bin/mfa", line 10, in <module>
    sys.exit(mfa_cli())
             ^^^^^^^^^
  File "/anaconda/envs/aligner/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/anaconda/envs/aligner/lib/python3.11/site-packages/rich_click/rich_command.py", line 126, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/anaconda/envs/aligner/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/anaconda/envs/aligner/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/anaconda/envs/aligner/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/anaconda/envs/aligner/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/anaconda/envs/aligner/lib/python3.11/site-packages/montreal_forced_aligner/command_line/align.py", line 122, in align_corpus_cli
    aligner.align()
  File "/anaconda/envs/aligner/lib/python3.11/site-packages/montreal_forced_aligner/alignment/pretrained.py", line 333, in align
    self.setup()
  File "/anaconda/envs/aligner/lib/python3.11/site-packages/montreal_forced_aligner/alignment/pretrained.py", line 207, in setup
    self.load_corpus()
  File "/anaconda/envs/aligner/lib/python3.11/site-packages/montreal_forced_aligner/corpus/acoustic_corpus.py", line 1089, in load_corpus
    self.generate_features()
  File "/anaconda/envs/aligner/lib/python3.11/site-packages/montreal_forced_aligner/corpus/acoustic_corpus.py", line 511, in generate_features
    self.generate_final_features()
  File "/anaconda/envs/aligner/lib/python3.11/site-packages/montreal_forced_aligner/corpus/acoustic_corpus.py", line 458, in generate_final_features
    raise FeatureGenerationError(
montreal_forced_aligner.exceptions.FeatureGenerationError: FeatureGenerationError:

No utterances had features, please check the logs in /home/v-zhikangniu/Documents/MFA/LibriSpeech/LibriSpeech/split3/log for errors.

and the mfa validate looks like successful?

mmcauliffe commented 5 months ago

Should be fixed in latest releases of 3.0.X

Aaashair commented 3 weeks ago

The same problem happens in 3.1.3.

nandishaivalli commented 2 weeks ago

I was facing the same issue for multi-speaker folders. when i did the alignment for individual files the error was no more. So i do not understand what is happening here.