Skip to content

AttributeError: module 'TTS.tts.datasets' has no attribute '' #775

Open

Description

@franzrichter-dev

Hello! I'm trying to train a tts model with my own voice and I've set up the config and metadata, recorded voicelines etc., but when I try to use compute_statistics.py to generate a scale_stats.py, I get this error:

Traceback (most recent call last):
  File "C:\Python311\Lib\site-packages\TTS\bin\compute_statistics.py", line 96, in <module>
    main()

  File "C:\Python311\Lib\site-packages\TTS\bin\compute_statistics.py", line 44, in main
    dataset_items = load_tts_samples(CONFIG.datasets)[0]  # take only train data
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\Python311\Lib\site-packages\TTS\tts\datasets\__init__.py", line 118, in load_tts_samples  
    formatter = _get_formatter_by_name(formatter_name)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\Python311\Lib\site-packages\TTS\tts\datasets\__init__.py", line 166, in _get_formatter_by_name
    return getattr(thismodule, name.lower())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

AttributeError: module 'TTS.tts.datasets' has no attribute ''

I don't know, what the error is here, because I have defined a dataset in the config and I don't know, if it has something to do with the config or any other file that this process relies on.

Activity

  1. xtraa commented on Jan 11, 2025

    @xtraa

    Yep same. tried with different formatters. It sucks

  2. hulamo commented on Mar 1, 2025

    @hulamo

    Hello have you resolved this ? Thank You

  3. franzrichter-dev commented on Mar 1, 2025

    @franzrichter-dev
    Author

    @hulamo I'm not really sure, since it has been more than a year. But yeah, I think I found a workaround, and it was another file in a subfolder or something

  4. franzrichter-dev commented on Mar 1, 2025

    @franzrichter-dev
    Author

    I'm going to try to find out, but I think I used some sort of workaround (I'm mainly writing this since I accidentally closed the issue previously)

  5. GoodDay360 commented on Jan 24, 2026

    @GoodDay360

    Incorrect config?
    try sth similar to this.

    {
      "audio": {
        "sample_rate": 16000,
        "num_mels": 80
      },
      "datasets": [
        {
          "formatter": "ljspeech",
          "meta_file_delimiter": "|",
          "path": "dataset/km_kh_female",
          "meta_file_train": "metadata_fixed.csv",
          "meta_file_val": "metadata_fixed.csv"
        }
      ],
      "model": "vits",
      "output_path": "output",
      "trainer": {
        "batch_size": 32,
        "num_epochs": 1000,
        "learning_rate": 0.0001
      }
    }
    
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions