MontrealCorpusTools / Montreal-Forced-Aligner

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

[BUG] called replace() on posixpath instead of string #591

Closed sophiazhi closed 1 year ago

sophiazhi commented 1 year ago

Debugging checklist

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

Describe the issue In transcription/transcriber.py line 604, I believe the path objects should be cast to string before calling replace, e.g. str(p).replace(str(self.working_directory), str(previous_working_directory)).

File "/home/szhi/miniconda3/envs/mfa2.2/lib/python3.9/site-packages/montreal_forced_aligner/transcription
/transcriber.py", line 604, in transcribe                                                                  
    p.replace(self.working_directory, previous_working_directory), p                                  
TypeError: replace() argument 1 must be str, not PosixPath

For Reproducing your issue Please fill out the following:

  1. Corpus structure: English, 10 files 7 speakers, lab transcriptions
  2. Dictionary: english_us_arpa
  3. Acoustic model: english_us_arpa

Command: mfa align first10_audio english_us_arpa eng lish_us_arpa first10_mfa_textgrids_upm --use_phone_model

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):

mmcauliffe commented 1 year ago

Fixed in 2.2.5.