MontrealCorpusTools / Montreal-Forced-Aligner

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

[BUG] Cannot align; Error changes when running Anaconda as administrator #749

Closed xelatronic closed 9 months ago

xelatronic commented 9 months ago

Debugging checklist

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

Describe the issue I'm in the process of moving to a new machine and can't get MFA to work on it. When I run align straight from the Anaconda prompt, the final error I get is an OSError saying it requires higher privileges. When I run as admin the error changes to a TypeError.

Command:

mfa align --clean -s 9 -a C:\Users\AMO104\MFA\MFA_RUNNING\NEW_COMPUTER_TEST\TEST_AUDIO C:\Users\AMO104\MFA\MFA_RUNNING\NEW_COMPUTER_TEST\TEST_STIM_LABS dafadapt_padded_dictionary dafadapt_padded_english_us_arpa C:\Users\AMO104\MFA\MFA_RUNNING\NEW_COMPUTER_TEST/TEST_STIM_OUTPUT

Non-admin error:

Exception ignored in atexit callback: <bound method ExitHooks.history_save_handler of <montreal_forced_aligner.command_line.mfa.ExitHooks object at 0x000001D7E13F2750>>
Traceback (most recent call last):
  File "C:\Users\AMO104\AppData\Local\anaconda3\envs\mfa_env\Lib\site-packages\montreal_forced_aligner\command_line\mfa.py", line 107, in history_save_handler
    raise self.exception
  File "C:\Users\AMO104\AppData\Local\anaconda3\envs\mfa_env\Scripts\mfa-script.py", line 9, in <module>
    sys.exit(mfa_cli())
             ^^^^^^^^^
  File "C:\Users\AMO104\AppData\Local\anaconda3\envs\mfa_env\Lib\site-packages\click\core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\AMO104\AppData\Local\anaconda3\envs\mfa_env\Lib\site-packages\rich_click\rich_command.py", line 126, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "C:\Users\AMO104\AppData\Local\anaconda3\envs\mfa_env\Lib\site-packages\click\core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\AMO104\AppData\Local\anaconda3\envs\mfa_env\Lib\site-packages\click\core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\AMO104\AppData\Local\anaconda3\envs\mfa_env\Lib\site-packages\click\core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\AMO104\AppData\Local\anaconda3\envs\mfa_env\Lib\site-packages\click\decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\AMO104\AppData\Local\anaconda3\envs\mfa_env\Lib\site-packages\montreal_forced_aligner\command_line\align.py", line 122, in align_corpus_cli
    aligner.align()
  File "C:\Users\AMO104\AppData\Local\anaconda3\envs\mfa_env\Lib\site-packages\montreal_forced_aligner\alignment\pretrained.py", line 334, in align
    super().align()
  File "C:\Users\AMO104\AppData\Local\anaconda3\envs\mfa_env\Lib\site-packages\montreal_forced_aligner\alignment\base.py", line 368, in align
    self.align_utterances()
  File "C:\Users\AMO104\AppData\Local\anaconda3\envs\mfa_env\Lib\site-packages\montreal_forced_aligner\alignment\mixins.py", line 306, in align_utterances
    for utterance, log_likelihood in run_kaldi_function(
  File "C:\Users\AMO104\AppData\Local\anaconda3\envs\mfa_env\Lib\site-packages\montreal_forced_aligner\utils.py", line 654, in run_kaldi_function
    raise v
  File "C:\Users\AMO104\AppData\Local\anaconda3\envs\mfa_env\Lib\site-packages\montreal_forced_aligner\utils.py", line 538, in run
    self.function.run()
  File "C:\Users\AMO104\AppData\Local\anaconda3\envs\mfa_env\Lib\site-packages\montreal_forced_aligner\abc.py", line 86, in run
    raise MultiprocessingError(self.job_name, error_text)
montreal_forced_aligner.exceptions.MultiprocessingError: MultiprocessingError:

Job 1 encountered an error:
Traceback (most recent call last):

  File "C:\Users\AMO104\AppData\Local\anaconda3\envs\mfa_env\Lib\site-packages\montreal_forced_aligner\abc.py", line 82, in run
    self._run()

  File "C:\Users\AMO104\AppData\Local\anaconda3\envs\mfa_env\Lib\site-packages\montreal_forced_aligner\alignment\multiprocessing.py", line 665, in _run
    job.construct_path(self.working_directory, "ali", "ark", dict_id).symlink_to(

  File "C:\Users\AMO104\AppData\Local\anaconda3\envs\mfa_env\Lib\pathlib.py", line 1198, in symlink_to
    os.symlink(target, self, target_is_directory)

OSError: [WinError 1314] A required privilege is not held by the client: 'C:\\Users\\AMO104\\MFA\\MFA_FILES\\TEST_STIM_LABS\\alignment\\ali_first_pass.1.1.ark' -> 'C:\\Users\\AMO104\\MFA\\MFA_FILES\\TEST_STIM_LABS\\alignment\\ali.1.1.ark'

Admin error:

Exception ignored in atexit callback: <bound method ExitHooks.history_save_handler of <montreal_forced_aligner.command_line.mfa.ExitHooks object at 0x00000296EB198750>>
Traceback (most recent call last):
  File "C:\Users\AMO104\AppData\Local\anaconda3\envs\mfa_env\Lib\site-packages\montreal_forced_aligner\command_line\mfa.py", line 107, in history_save_handler
    raise self.exception
  File "C:\Users\AMO104\AppData\Local\anaconda3\envs\mfa_env\Scripts\mfa-script.py", line 9, in <module>
    sys.exit(mfa_cli())
             ^^^^^^^^^
  File "C:\Users\AMO104\AppData\Local\anaconda3\envs\mfa_env\Lib\site-packages\click\core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\AMO104\AppData\Local\anaconda3\envs\mfa_env\Lib\site-packages\rich_click\rich_command.py", line 126, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "C:\Users\AMO104\AppData\Local\anaconda3\envs\mfa_env\Lib\site-packages\click\core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\AMO104\AppData\Local\anaconda3\envs\mfa_env\Lib\site-packages\click\core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\AMO104\AppData\Local\anaconda3\envs\mfa_env\Lib\site-packages\click\core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\AMO104\AppData\Local\anaconda3\envs\mfa_env\Lib\site-packages\click\decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\AMO104\AppData\Local\anaconda3\envs\mfa_env\Lib\site-packages\montreal_forced_aligner\command_line\align.py", line 122, in align_corpus_cli
    aligner.align()
  File "C:\Users\AMO104\AppData\Local\anaconda3\envs\mfa_env\Lib\site-packages\montreal_forced_aligner\alignment\pretrained.py", line 334, in align
    super().align()
  File "C:\Users\AMO104\AppData\Local\anaconda3\envs\mfa_env\Lib\site-packages\montreal_forced_aligner\alignment\base.py", line 374, in align
    self.calc_fmllr()
  File "C:\Users\AMO104\AppData\Local\anaconda3\envs\mfa_env\Lib\site-packages\montreal_forced_aligner\corpus\acoustic_corpus.py", line 709, in calc_fmllr
    for _ in run_kaldi_function(CalcFmllrFunction, arguments, pbar.update):
  File "C:\Users\AMO104\AppData\Local\anaconda3\envs\mfa_env\Lib\site-packages\montreal_forced_aligner\utils.py", line 654, in run_kaldi_function
    raise v
  File "C:\Users\AMO104\AppData\Local\anaconda3\envs\mfa_env\Lib\site-packages\montreal_forced_aligner\utils.py", line 538, in run
    self.function.run()
  File "C:\Users\AMO104\AppData\Local\anaconda3\envs\mfa_env\Lib\site-packages\montreal_forced_aligner\abc.py", line 86, in run
    raise MultiprocessingError(self.job_name, error_text)
montreal_forced_aligner.exceptions.MultiprocessingError: MultiprocessingError:

Job 1 encountered an error:
Traceback (most recent call last):

  File "C:\Users\AMO104\AppData\Local\anaconda3\envs\mfa_env\Lib\site-packages\montreal_forced_aligner\abc.py", line 82, in run
    self._run()

  File "C:\Users\AMO104\AppData\Local\anaconda3\envs\mfa_env\Lib\site-packages\montreal_forced_aligner\corpus\features.py", line 497, in _run
    computer = FmllrComputer(
               ^^^^^^^^^^^^^^

TypeError: FmllrComputer.__init__() got an unexpected keyword argument 'two_models'

For Reproducing your issue Please fill out the following:

  1. Corpus structure
    • What language is the corpus in? English
    • How many files/speakers? 1 speaker, 50 files (~3 minutes of speech)
    • Are you using lab files or TextGrid files for input? .lab
  2. Dictionary
    • Are you using a dictionary from MFA? If so, which one? No
    • If it's a custom dictionary, what is the phoneset? [AA1, UW1, IY1, B, D, G, ZH]
  3. Acoustic model
    • If you're using an acoustic model, is it one download through MFA? If so, which one? Adapted from english_us_arpa
    • If it's a model you've trained, what data was it trained on? Data from same experiment as the corpus to be aligned; ~15 hours of non-word syllable sequences annotated as text.

Log file TEST_STIM_LABS_NOTADMIN.log, TEST_STIM_LABS_ADMIN.log

Desktop (please complete the following information):

Additional context Trying to validate also throws an error. Reverting to previous versions does not solve. The data I'm trying to align has previously been aligned successfully on my old machine.

delale commented 9 months ago

Same error on osx-arm64 14.0: mfa align --clean --textgrid_cleanup --include_original_text --overwrite --use_mp -s 5 transcribed_psychopy_test english_us_mfa english_mfa test_output

Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/Users/aledel/miniconda3/envs/tdgameenv/lib/python3.9/site-packages/montreal_forced_aligner/abc.py", line 82, in run
    self._run()
  File "/Users/aledel/miniconda3/envs/tdgameenv/lib/python3.9/site-packages/montreal_forced_aligner/corpus/features.py", line 497, in _run
    computer = FmllrComputer(
TypeError: __init__() got an unexpected keyword argument 'two_models'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/aledel/miniconda3/envs/tdgameenv/bin/mfa", line 10, in <module>
    sys.exit(mfa_cli())
  File "/Users/aledel/miniconda3/envs/tdgameenv/lib/python3.9/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/Users/aledel/miniconda3/envs/tdgameenv/lib/python3.9/site-packages/rich_click/rich_command.py", line 126, in main
    rv = self.invoke(ctx)
  File "/Users/aledel/miniconda3/envs/tdgameenv/lib/python3.9/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/aledel/miniconda3/envs/tdgameenv/lib/python3.9/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/aledel/miniconda3/envs/tdgameenv/lib/python3.9/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/Users/aledel/miniconda3/envs/tdgameenv/lib/python3.9/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Users/aledel/miniconda3/envs/tdgameenv/lib/python3.9/site-packages/montreal_forced_aligner/command_line/align.py", line 122, in align_corpus_cli
    aligner.align()
  File "/Users/aledel/miniconda3/envs/tdgameenv/lib/python3.9/site-packages/montreal_forced_aligner/alignment/pretrained.py", line 334, in align
    super().align()
  File "/Users/aledel/miniconda3/envs/tdgameenv/lib/python3.9/site-packages/montreal_forced_aligner/alignment/base.py", line 374, in align
    self.calc_fmllr()
  File "/Users/aledel/miniconda3/envs/tdgameenv/lib/python3.9/site-packages/montreal_forced_aligner/corpus/acoustic_corpus.py", line 709, in calc_fmllr
    for _ in run_kaldi_function(CalcFmllrFunction, arguments, pbar.update):
  File "/Users/aledel/miniconda3/envs/tdgameenv/lib/python3.9/site-packages/montreal_forced_aligner/utils.py", line 654, in run_kaldi_function
    raise v
  File "/Users/aledel/miniconda3/envs/tdgameenv/lib/python3.9/site-packages/montreal_forced_aligner/utils.py", line 538, in run
    self.function.run()
  File "/Users/aledel/miniconda3/envs/tdgameenv/lib/python3.9/site-packages/montreal_forced_aligner/abc.py", line 86, in run
    raise MultiprocessingError(self.job_name, error_text)
montreal_forced_aligner.exceptions.MultiprocessingError: MultiprocessingError:

Job 2 encountered an error:
Traceback (most recent call last):

  File "/Users/aledel/miniconda3/envs/tdgameenv/lib/python3.9/site-packages/montreal_forced_aligner/abc.py", line 82, in run
    self._run()

  File "/Users/aledel/miniconda3/envs/tdgameenv/lib/python3.9/site-packages/montreal_forced_aligner/corpus/features.py", line 497, in _run
    computer = FmllrComputer(

TypeError: __init__() got an unexpected keyword argument 'two_models'

MFA version: 3.0.0a8

xelatronic commented 9 months ago

As of the latest update 3.0.0rc2 I no longer get the TypeError, but I still can only run MFA when running the Anaconda Prompt as administrator. That's not an issue for my workflow, but any idea what dependency might be causing that and/or how to resolve? I have Anaconda installed globally on this machine.