Skip to content

Instantly share code, notes, and snippets.

@NTT123
Last active June 24, 2024 12:37
Show Gist options
  • Save NTT123/12264d15afad861cb897f7a20a01762e to your computer and use it in GitHub Desktop.
Save NTT123/12264d15afad861cb897f7a20a01762e to your computer and use it in GitHub Desktop.
MFA LJSpeech.ipynb
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@MIRROR116
Copy link

@Eran-BA @rbracco have the same issue, but my lexicon is pinyin-lexicon.txt

@NTT123
Copy link
Author

NTT123 commented Nov 3, 2022

Hi @Eran-BA @rbracco @MIRROR116, thank you for reporting this! I have fixed the issue. See: MontrealCorpusTools/Montreal-Forced-Aligner#480 (comment) for more information.

@netpi
Copy link

netpi commented Feb 24, 2023

hi @NTT123, running last section showed the error initdb: error: cannot be run as root .
I fix that below :

!adduser mfa 
!usermod -aG sudo mfa
!su mfa

pipline input:

!source /tmp/mfa/miniconda3/bin/activate aligner; mfa align -t ./temp -j 4 ./wav modified_librispeech-lexicon.txt ./english.zip ./ljs_aligned

🤔 By the way, how to show data like this gist main picture? thx!

@yanirmr
Copy link

yanirmr commented Mar 6, 2023

Hi there, thank you for sharing this notebook! I've been trying to use the MFA code provided, but unfortunately, the last cell doesn't seem to be working for me. I receive the following error message:

Exception ignored in atexit callback: <bound method ExitHooks.history_save_handler of <montreal_forced_aligner.command_line.mfa.ExitHooks object at 0x7f22c5a8ceb0>>
Traceback (most recent call last):
  File "/tmp/mfa/miniconda3/envs/aligner/lib/python3.10/site-packages/montreal_forced_aligner/command_line/mfa.py", line 95, in history_save_handler
    raise self.exception
  File "/tmp/mfa/miniconda3/envs/aligner/bin/mfa", line 11, in <module>
    sys.exit(mfa_cli())
  File "/tmp/mfa/miniconda3/envs/aligner/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/tmp/mfa/miniconda3/envs/aligner/lib/python3.10/site-packages/rich_click/rich_group.py", line 21, in main
    rv = super().main(*args, standalone_mode=False, **kwargs)
  File "/tmp/mfa/miniconda3/envs/aligner/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/tmp/mfa/miniconda3/envs/aligner/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/tmp/mfa/miniconda3/envs/aligner/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/tmp/mfa/miniconda3/envs/aligner/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/tmp/mfa/miniconda3/envs/aligner/lib/python3.10/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/tmp/mfa/miniconda3/envs/aligner/lib/python3.10/site-packages/montreal_forced_aligner/command_line/align.py", line 99, in align_corpus_cli
    check_databases()
  File "/tmp/mfa/miniconda3/envs/aligner/lib/python3.10/site-packages/montreal_forced_aligner/command_line/utils.py", line 272, in check_databases
    subprocess.check_call(
  File "/tmp/mfa/miniconda3/envs/aligner/lib/python3.10/subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['initdb', '-D', 'temp/pg_mfa_global', '--encoding=UTF8']' returned non-zero exit status 1.

I believe this may be due to an issue with the initdb command, which appears to be returning a non-zero exit status. Would you happen to have any suggestions on how I could go about resolving this issue? Thank you!

@netpi
Copy link

netpi commented Mar 6, 2023

@yanirmr
you can't run as a root user.
adduser and su to will fix it

!adduser mfa 
!usermod -aG sudo mfa
!su mfa

@yanirmr
Copy link

yanirmr commented Mar 6, 2023

Thank you for your help with the MFA code. Unfortunately, the solution you suggested didn't work and I'm still experiencing the same error message. Do you have any other suggestions for how I could resolve this issue, or could it be an issue with how I'm embedding the code into the notebook?

Thanks for your time and assistance.

@Aloento
Copy link

Aloento commented Apr 20, 2023

I have this err


The global MFA database server does not exist, initializing it first.
pg_ctl stdout: 
pg_ctl stderr: initdb: error: cannot be run as root
initdb: hint: Please log in (using, e.g., "su") as the (unprivileged) user that will own the server process.

Traceback (most recent call last):
  File "/tmp/mfa/miniconda3/envs/aligner/bin/mfa", line 10, in <module>
    sys.exit(mfa_cli())
  File "/tmp/mfa/miniconda3/envs/aligner/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/tmp/mfa/miniconda3/envs/aligner/lib/python3.10/site-packages/rich_click/rich_group.py", line 21, in main
    rv = super().main(*args, standalone_mode=False, **kwargs)
  File "/tmp/mfa/miniconda3/envs/aligner/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/tmp/mfa/miniconda3/envs/aligner/lib/python3.10/site-packages/click/core.py", line 1654, in invoke
    super().invoke(ctx)
  File "/tmp/mfa/miniconda3/envs/aligner/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/tmp/mfa/miniconda3/envs/aligner/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/tmp/mfa/miniconda3/envs/aligner/lib/python3.10/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/tmp/mfa/miniconda3/envs/aligner/lib/python3.10/site-packages/montreal_forced_aligner/command_line/mfa.py", line 140, in mfa_cli
    start_server()
  File "/tmp/mfa/miniconda3/envs/aligner/lib/python3.10/site-packages/montreal_forced_aligner/command_line/utils.py", line 408, in start_server
    initialize_server()
  File "/tmp/mfa/miniconda3/envs/aligner/lib/python3.10/site-packages/montreal_forced_aligner/command_line/utils.py", line 320, in initialize_server
    raise DatabaseError(
montreal_forced_aligner.exceptions.DatabaseError: DatabaseError:

There was an error encountered starting the global MFA database server, please see /root/Documents/MFA/pg_init_log_global.txt for more details and/or look at the logged errors above.

@frouhi
Copy link

frouhi commented May 14, 2023

I'm having the same issue:

The global MFA database server does not exist, initializing it first.
pg_ctl stdout:
pg_ctl stderr: initdb: error: cannot be run as root
initdb: hint: Please log in (using, e.g., "su") as the (unprivileged) user that will own the server process.

I did try this as suggested:

!adduser mfa
!usermod -aG sudo mfa
!su mfa

but it didn't work :( I'd appreciate any suggestions .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment