Giter Club home page Giter Club logo

Comments (8)

reb1302 avatar reb1302 commented on May 29, 2024 1

It seems the issue was related to multiprocessing. I tried encapsulating the main code in train.py by defining it within a def main(): and it worked.
here is an example:

import os
from trainer import Trainer, TrainerArgs
from TTS.tts.configs.glow_tts_config import GlowTTSConfig
from TTS.tts.configs.shared_configs import BaseDatasetConfig
from TTS.tts.datasets import load_tts_samples
from TTS.tts.models.glow_tts import GlowTTS
from TTS.tts.utils.text.tokenizer import TTSTokenizer
from TTS.utils.audio import AudioProcessor

def main():
    output_path = os.path.dirname(os.path.abspath(__file__))
    dataset_config = BaseDatasetConfig(
        formatter="ipa_format",
        path="E://model//DATASET//viet-tts",
        meta_file_train="E://model//DATASET//viet-tts//meta_data.tsv",
    )

    config = GlowTTSConfig(
        # Configuration parameters
    )

    ap = AudioProcessor.init_from_config(config)
    tokenizer, config = TTSTokenizer.init_from_config(config)
    train_samples, eval_samples = load_tts_samples(
        # Loading samples parameters
    )
    model = GlowTTS(config, ap, tokenizer, speaker_manager=None)
    trainer = Trainer(
        TrainerArgs(), config, output_path, model=model, train_samples=train_samples, eval_samples=eval_samples
    )

    trainer.fit()

if __name__ == '__main__':
    main()

from tts.

lexkoro avatar lexkoro commented on May 29, 2024

AssertionError: ❗ len(DataLoader) returns 0. Make sure your dataset is not empty or len(dataset) > 0.

Validate your custom formatter works correctly.

from tts.

aryamanstha avatar aryamanstha commented on May 29, 2024

@lexkoro the formatter works correctly i guess. When i print the training samples and evaluation samples I obtain the following result:
image

from tts.

lexkoro avatar lexkoro commented on May 29, 2024

@aryamanstha Why do the audio_files have no extension?

from tts.

aryamanstha avatar aryamanstha commented on May 29, 2024

@aryamanstha Why do the audio_files have no extension?

The formatter doesn't place the extension in the audio_file name. However all the audio files have .wav extension.
image

from tts.

reb1302 avatar reb1302 commented on May 29, 2024

same issue : During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 1, in
File "C:\Users\AZPC\AppData\Local\Programs\Python\Python311\Lib\multiprocessing\spawn.py", line 122, in spawn_main
exitcode = _main(fd, parent_sentinel)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\AZPC\AppData\Local\Programs\Python\Python311\Lib\multiprocessing\spawn.py", line 131, in _main
prepare(preparation_data)
File "C:\Users\AZPC\AppData\Local\Programs\Python\Python311\Lib\multiprocessing\spawn.py", line 244, in prepare
_fixup_main_from_name(data['init_main_from_name'])
File "C:\Users\AZPC\AppData\Local\Programs\Python\Python311\Lib\multiprocessing\spawn.py", line 268, in _fixup_main_from_name
main_content = runpy.run_module(mod_name,
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 226, in run_module
File "", line 98, in _run_module_code
File "", line 88, in _run_code
File "E:\TTS\TTS\recipes\ljspeech\glow_tts\train_glowtts.py", line 90, in
trainer.fit()
File "C:\Users\AZPC\AppData\Local\Programs\Python\Python311\Lib\site-packages\trainer\trainer.py", line 1860, in fit
remove_experiment_folder(self.output_path)
File "C:\Users\AZPC\AppData\Local\Programs\Python\Python311\Lib\site-packages\trainer\generic_utils.py", line 77, in remove_experiment_folder
fs.rm(experiment_path, recursive=True)
File "C:\Users\AZPC\AppData\Local\Programs\Python\Python311\Lib\site-packages\fsspec\implementations\local.py", line 185, in rm
shutil.rmtree(p)
File "C:\Users\AZPC\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 787, in rmtree
return _rmtree_unsafe(path, onerror)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\AZPC\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 634, in _rmtree_unsafe
onerror(os.unlink, fullname, sys.exc_info())
File "C:\Users\AZPC\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 632, in _rmtree_unsafe
os.unlink(fullname)
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'E:/TTS/TTS/recipes/ljspeech/glow_tts/run-April-03-2024_07+09PM-dbf1a08a\trainer_0_log.txt'

from tts.

4ll0w3v1l avatar 4ll0w3v1l commented on May 29, 2024

yep, i have the same issue, though on windows it's WinError 32, while on mac it gives AssertionError as in OP's traceback, before permission error

from tts.

reb1302 avatar reb1302 commented on May 29, 2024

I have tried every possible way, it feels like a train code is creating a folder containing log files, and it cannot be changed, related to TensorBoard

from tts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.