MontrealCorpusTools / Montreal-Forced-Aligner

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

Running MFA>=3.0.0 on a CPU-only machine #774

Closed shreeshailgan closed 7 months ago

shreeshailgan commented 7 months ago

Is your feature request related to a problem? Please describe. I want to get MFA alignments on a dataset. However, since MFA only requires CPU, I'm working on a CPU-only machine. However, when I use any version of MFA>=3.0.0, I get the following error

Traceback (most recent call last):
  File "/root/miniconda3/envs/mfa300/bin/mfa", line 6, in <module>
    from montreal_forced_aligner.command_line.mfa import mfa_cli
  File "/root/miniconda3/envs/mfa300/lib/python3.9/site-packages/montreal_forced_aligner/__init__.py", line 4, in <module>
    import montreal_forced_aligner.acoustic_modeling as acoustic_modeling
  File "/root/miniconda3/envs/mfa300/lib/python3.9/site-packages/montreal_forced_aligner/acoustic_modeling/__init__.py", line 7, in <module>
    from montreal_forced_aligner.acoustic_modeling.base import AcousticModelTrainingMixin  # noqa
  File "/root/miniconda3/envs/mfa300/lib/python3.9/site-packages/montreal_forced_aligner/acoustic_modeling/base.py", line 12, in <module>
    from _kalpy.gmm import AccumAmDiagGmm
ImportError: libcuda.so.1: cannot open shared object file: No such file or directory

Since it is a CPU only machine, I do not have NVIDIA CUDA library installed, and hence, libcuda.so.1 does not exist. This is preventing me from running MFA>=3.0.0 on a CPU-only machine This is due to the inclusion of kalpy since the first v3.

Describe the solution you'd like Being able to run the latest MFA-3 version on a CPU-only machine.

Describe alternatives you've considered Right now, I'm using MFA==2.0 instead. However, I would really like to use the latest version.

mmcauliffe commented 7 months ago

Can you try running conda install kaldi=*=cpu* in your environment to force kaldi to its CPU version and see if that fixes it for you? Not sure why the cuda version is getting installed when you don't have any cuda toolkits also getting installed.

shreeshailgan commented 7 months ago

Yes. That worked. Thank you so much.