Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] DLL load failed while importing _kalpy #731

Open
ghost opened this issue Jan 9, 2024 · 11 comments
Open

[BUG] DLL load failed while importing _kalpy #731

ghost opened this issue Jan 9, 2024 · 11 comments
Assignees
Labels

Comments

@ghost
Copy link

ghost commented Jan 9, 2024

Debugging checklist

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

Describe the issue
When I type mfa version into the Anaconda Prompt (Miniconda3), I get the following issue:
Traceback (most recent call last):
File "C:\ProgramData\miniconda3\envs\aligner\Scripts\mfa-script.py", line 5, in
from montreal_forced_aligner.command_line.mfa import mfa_cli
File "C:\ProgramData\miniconda3\envs\aligner\lib\site-packages\montreal_forced_aligner_init_.py", line 4, in
import montreal_forced_aligner.acoustic_modeling as acoustic_modeling
File "C:\ProgramData\miniconda3\envs\aligner\lib\site-packages\montreal_forced_aligner\acoustic_modeling_init_.py", line 7, in
from montreal_forced_aligner.acoustic_modeling.base import AcousticModelTrainingMixin # noqa
File "C:\ProgramData\miniconda3\envs\aligner\lib\site-packages\montreal_forced_aligner\acoustic_modeling\base.py", line 12, in
from _kalpy.gmm import AccumAmDiagGmm
ImportError: DLL load failed while importing _kalpy: The specified module could not be found.

For Reproducing your issue
Open Anaconda Prompt (Miniconda3)
conda activate aligner
mfa version

  1. Corpus structure
    • What language is the corpus in?
    • How many files/speakers?
    • Are you using lab files or TextGrid files for input?
  2. Dictionary
    • Are you using a dictionary from MFA? If so, which one?
    • 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?
    • If it's a model you've trained, what data was it trained on?

Log file
Please attach the log file for the run that encountered an error (by default these will be stored in ~/Documents/MFA).

Desktop (please complete the following information):

  • OS: [Windows]
  • Version [Windows 10]
  • Any other details about the setup (Cloud, Docker, etc)

Additional context
Add any other context about the problem here.

@ghost ghost added the bug label Jan 9, 2024
@ghost ghost assigned mmcauliffe Jan 9, 2024
@ghost ghost closed this as completed Jan 11, 2024
@edappen
Copy link

edappen commented Jan 25, 2024

How did you resolve this issue?

@yeungpinghei
Copy link

I'm running into the same issue. May I know how you fixed it?

@SaurabhKNath
Copy link

Same issue. Please help!

@Kedersha
Copy link

Same here! Not sure if closed issues always generate notifications, so I'm going to tag @shozuru as well. Do you recall what you did to resolve this issue?

@mmcauliffe
Copy link
Member

Hi all, I'm having trouble replicating this, but if you can provide the following information, that would help in me tracking down the root cause:

  1. What version of Windows are you running? I've only seen reports on Windows 10 so far, and I only have access to Windows 11.
  2. For your environment, what is the output of running conda list? Specifically looking at the version of montreal-forced-aligner, kalpy and kaldi.

Can you try out some potential fixes and see if any of them fix the issue:

  1. Double check you're using the cpu version of Kaldi, as there was this issue: Running MFA>=3.0.0 on a CPU-only machine #774 (on Linux, and I'm not sure if the issue would manifest as a DLL load error on windows, but it might), so try running conda install -c conda-forge kaldi=5.5.1112=cpu*
  2. Use mamba as a solver, see the note in https://montreal-forced-aligner.readthedocs.io/en/latest/installation.html#general-installation and then run mamba update -c conda-forge montreal-forced-aligner --update-deps to make sure everything's up to the latest version (you can try using --update-deps with base conda, but I find the environment solving very slow)
  3. Re-create an environment with specific versions: conda create -n aligner -c conda-forge python=3.11 montreal-forced-aligner=3.0.2 kalpy=0.6.2 kaldi=5.5.1112=cpu*
  4. Try environments with different versions of python in case there's some interaction with Windows 10/MSVC versions?

@mmcauliffe mmcauliffe reopened this Mar 14, 2024
@ghost
Copy link
Author

ghost commented Mar 14, 2024

If I remember correctly, I uninstalled and then installed a more stable version (some version < 2.9), and that seemed to fix it.
conda create -n aligner -c conda-forge "montreal-forced-aligner<2.9" I also ran Anaconda PowerShell as an administrator if that changes anything.

@SaurabhKNath
Copy link

Hi Michael, @mmcauliffe, I am using Windows 10 and the versions of montreal-forced-aligner, kalpy, kaldi were 3.0.2, 0.6.3, 5.5.1112 respectively.

Thanks for sharing the fixes, and the 3rd option fixed the issue of importing _kalpy and allowed me to go to the mfa validate xx step, which was successful. However, when I ran mfa align xx, I got another error called [WinError 183]. Please see the screenshot attached. Do you have any suggestions for fixing this? Thanks a lot.

PS: I'm working on Assamese using the english_mfa acoustic model.

screenshot

@HamidMojarrad
Copy link

HamidMojarrad commented Mar 26, 2024

I am having the same problem. I found the problem in both my Windows and Linux computers. Would you please walk me through the solution? Downgrading the aligner to a lower version might help but it lacks enough acoustic and dictionary dataset.

@lcavasso
Copy link

lcavasso commented Mar 28, 2024

Here's the requested info from one computer that had this issue. Using conda create -n aligner -c conda-forge python=3.11 montreal-forced-aligner=3.0.2 kalpy=0.6.2 kaldi=5.5.1112=cpu* resolved it

OS: Windows 11 Home Edition 22H2
output of conda list: conda list.txt

@camille-lnrs
Copy link

Hey everyone,
I have the same error and the line conda create -n aligner -c conda-forge python=3.11 montreal-forced-aligner=3.0.2 kalpy=0.6.2 kaldi=5.5.1112=cpu* havn't resolved the problem. Any other cues ? I tried all the mentionned solution and mfa works in terminal but not in python, however I do need it to work on python.

OS : Windows 11

Thank you in advanced !

@mmcauliffe
Copy link
Member

Can you try running conda update -c montreal-forced-aligner kalpy kaldi=*=cpu* --update-deps? That will get the latest version that should be synced across all versions. From 3.0.5 onward, there is a mfa_update command you can run that will get the latest versions of everything, see: https://montreal-forced-aligner.readthedocs.io/en/latest/installation.html#updating-montreal-forced-aligner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants