Moon-sung-woo / MIST_Tacotron

BSD 3-Clause "New" or "Revised" License
6 stars 0 forks source link

emotion = parts[2] IndexError: list index out of range #2

Closed mjk321 closed 1 year ago

mjk321 commented 2 years ago

Hi, I'm trying to use a Japanese dataset. I made the filelist look like this: dataset/ang/wav/angry-0.wav|Kimurasan wa watashi ni shashin wo misete kuremashita. dataset/ang/wav/angry-1.wav|Tero ga arukara yameroto, sanzan, iwareta. and so on. but I keep getting this error

Traceback (most recent call last):
  File "train.py", line 598, in <module>
    main()
  File "train.py", line 467, in main
    model_name, args.dataset_path, args.training_files, args)
  File "F:\colab\MIST_Tacotron-master\data_functions.py", line 51, in get_data_loader
    data_loader = TextMelLoader(dataset_path, audiopaths_and_text, args)
  File "F:\colab\MIST_Tacotron-master\tacotron2\data_function.py", line 46, in __init__
    self.audiopaths_and_text = load_filepaths_and_text(dataset_path, audiopaths_and_text)
  File "F:\colab\MIST_Tacotron-master\common\utils.py", line 76, in load_filepaths_and_text
    filepaths_and_text = [split_line(dataset_path, line) for line in f]
  File "F:\colab\MIST_Tacotron-master\common\utils.py", line 76, in <listcomp>
    filepaths_and_text = [split_line(dataset_path, line) for line in f]
  File "F:\colab\MIST_Tacotron-master\common\utils.py", line 73, in split_line
    emotion = parts[2]
IndexError: list index out of range

it seems the error coming from common/utils.py 's load_filepaths_and_text

def load_filepaths_and_text(dataset_path, filename, split="|"):
    with open(filename, encoding='utf-8') as f:
        def split_line(root, line):
            parts = line.strip().split(split)
            print(parts)
            if len(parts) > 4:
                raise Exception(
                    "incorrect line format for file: {}".format(filename))
            path = os.path.join(root, parts[0])
            text = parts[1]
            emotion = parts[2]
            speaker = parts[3]
            return path, text, emotion, speaker
        filepaths_and_text = [split_line(dataset_path, line) for line in f]
    return filepaths_and_text

where parts is only split by "|". can you help?

Moon-sung-woo commented 1 year ago

Hi You should make filelists like this file path|script|emotion|speaker ID

mjk321 commented 1 year ago

you should update the read me to reflect that pls. also, what is speaker ID?

Moon-sung-woo commented 1 year ago

I update the read me. speaker Id is speaker name. But it type is int not str so you should change.

Moon-sung-woo commented 1 year ago

Close due to inactivity.