MontrealCorpusTools / Montreal-Forced-Aligner

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

FileNotFoundError: [Errno 2] #44

Closed cchara11 closed 6 years ago

cchara11 commented 7 years ago

Hello,

Currently trying to run v.1.0.0 in Ubuntu but I am having the following error:

bin/mfa_align ~/Downloads/LibriSpeech ~/Documents/librispeech-lexicon.txt english ~/Documents/aligned_speech Setting up corpus information... Number of speakers in corpus: 40, average number of utterances per speaker: 65.5 Creating dictionary information... Setting up training data... Calculating MFCCs... Traceback (most recent call last): File "aligner/command_line/align.py", line 186, in File "aligner/command_line/align.py", line 144, in validate_args File "aligner/command_line/align.py", line 139, in align_included_model File "aligner/command_line/align.py", line 93, in align_corpus File "aligner/aligner/pretrained.py", line 71, in init File "aligner/aligner/pretrained.py", line 117, in setup File "aligner/aligner/base.py", line 80, in setup File "aligner/corpus.py", line 970, in initialize_corpus File "aligner/corpus.py", line 848, in create_mfccs File "aligner/corpus.py", line 859, in _combine_feats FileNotFoundError: [Errno 2] No such file or directory: '/Documents/MFA/LibriSpeech/train/mfcc/raw_mfcc.0.scp' Failed to execute script align

Any thoughts on that? Seems that it was an issue in previous versions. I have tried the solution proposed (remove the train directory), but still cannot manage to run it successfully.

Waiting for your response, Constantinos

insa-k commented 7 years ago

Hi all, I have the same problem, is there any solution yet?

Best, Insa

Edit: The windows release works just fine so this is a problem specific to the linux release.

psibre commented 7 years ago

I can confirm that the same command with the same data works with 1.0.0 on macOS (Sierra), but fails with the above error under linux (tested on Ubuntu Xenial).

mmcauliffe commented 7 years ago

Ok, thanks for the reports, I'll take a look into this soon! In the meantime, could you look at the Kaldi logs (train/mfcc/log/make_mfcc.0.log) and let me know if anything is popping up there?

insa-k commented 7 years ago

This is what's in my train/mfcc/log/make_mfcc.0.log:

compute-mfcc-feats: error while loading shared libraries: libcblas.so.3: cannot open shared object file: No such file or directory
copy-feats: error while loading shared libraries: libcblas.so.3: cannot open shared object file: No such file or directory
psibre commented 7 years ago

Based on @insa-k's feedback, I debugged the error in an ubuntu:xenial docker sandbox. With the stock image, I again got the same error as reported above:

# bin/mfa_train_and_align no-atlas/forcedAlignment no-atlas/forcedAlignment/dict.txt no-atlas/output -t no-atlas/tmp -o no-atlas/models 
Setting up corpus information...
Creating dictionary information...
fstarcsort: error while loading shared libraries: /mfa/lib/thirdparty/bin/libfstscript.so.7: unexpected PLT reloc type 0x10ec8348
Setting up training data...
Calculating MFCCs...
Traceback (most recent call last):
  File "aligner/command_line/train_and_align.py", line 165, in <module>
  File "aligner/command_line/train_and_align.py", line 66, in align_corpus
  File "aligner/aligner/base.py", line 76, in __init__
  File "aligner/aligner/base.py", line 80, in setup
  File "aligner/corpus.py", line 970, in initialize_corpus
  File "aligner/corpus.py", line 848, in create_mfccs
  File "aligner/corpus.py", line 859, in _combine_feats
FileNotFoundError: [Errno 2] No such file or directory: 'no-atlas/tmp/forcedAlignment/train/mfcc/raw_mfcc.0.scp'
Failed to execute script train_and_align

Then I installed the libatlas3-base package (which provides libcblas.so.3) and tried anew:

bin/mfa_train_and_align atlas/forcedAlignment atlas/forcedAlignment/dict.txt atlas/output -t atlas/tmp -o atlas/models
Setting up corpus information...
Creating dictionary information...
Setting up training data...
Calculating MFCCs...
Calculating CMVN...
Number of speakers in corpus: 1, average number of utterances per speaker: 24.0
Beginning monophone training...
100%|###############################################################################| 39/39 [00:51<00:00,  1.03s/it]
Initializing triphone training...
Beginning triphone training...
100%|###############################################################################| 34/34 [00:42<00:00,  1.14it/s]
Initializing speaker-adapted triphone training...
Beginning speaker-adapted triphone training...
100%|###############################################################################| 34/34 [00:36<00:00,  1.41it/s]
Saved model to atlas/models

TL;DR

This issue can be solved by installing libcblas.so.3, e.g., by running sudo apt-get install libatlas3-base on Ubuntu/Debian.

@mmcauliffe But I suppose you would want to package the corresponding library in the linux release, just like in the win64 one.

mmcauliffe commented 6 years ago

@psibre Thanks for this! For the moment, I've added an installation step for the Linux instructions (http://montreal-forced-aligner.readthedocs.io/en/latest/installation.html#linux). I'll think about whether to include it in the binary for later distributions, the only reason it's in the Windows one is that it's more painful to install there than Linux.