I am trying to reproduce fastspech2 tarining but when i do this in colab it points to ModuleNotFoundError in training part
but prerpocessing part was succeeded
!CUDA_VISIBLE_DEVICES=0 python /content/TensorflowTTS/examples/fastspeech2/train_fastspeech2.py \
--train-dir /content/dump/train/ \
--dev-dir /content/dump/valid/ \
--outdir /content/TensorflowTTS/examples/fastspeech2/exp/train.fastspeech2.v1/ \
--config /content/TensorflowTTS/examples/fastspeech2/conf/fastspeech2.v1.yaml \
--use-norm 1 \
--f0-stat /content/TensorflowTTS/dump/stats_f0.npy \
--energy-stat /content/TensorflowTTS/dump/stats_energy.npy \
--mixed_precision 1 \
--resume ""
Traceback (most recent call last):
File "/content/TensorflowTTS/examples/fastspeech2/train_fastspeech2.py", line 21, in
from examples.fastspeech2.fastspeech2_dataset import CharactorDurationF0EnergyMelDataset
ModuleNotFoundError: No module named 'examples.fastspeech2'
@MokkeMeguru can you check and help ?
@MODAK27
Google Colab has a module (or it's the folder?) conveniently named examples that make it conflict with this repo. To fix it, in my training notebooks I always run a piece of code that renames the examples folder into ttsexamples and replaces examples. with ttsexamples. in all the code recursively right after cloning the repo.
Talking about notebooks, an example training one would be nice.
@ZDisket sorry it didn't help, even though colab has examples inbuilt, it will always first look on to path provided at first by user to look on to modules.
I fixed the bug. python 3.6 even requires the__init__.py module to treat directories containing files as packages.
I update the code of fastspeech2.
@MODAK27 __init__.py is not needed in our settings.
You can do our example in python 3.6. after my pull request (#98) is merged.
git clone https://github.com/TensorSpeech/TensorflowTTS TTTS
cd TTTS
docker-compose build
docker-compose up -d
docker-compose exec tensorflowtts /bin/bash
python --version
# 3.6.9
python examples/fastspeech2/train_fastspeech2.py
@ZDisket
I don't know colab well. It is th colab-dependencies problem.
>
You are correct
import examples
examples
# <module 'examples' from '/usr/local/lib/python3.6/dist-packages/examples/__init__.py'>
And also, we can easily remove the example folder from colab environment with the below code.
import examples
!rm -r {'/'.join(examples.__file__.split('/')[:-1])}
import os
!git clone https://github.com/TensorSpeech/TensorflowTTS TTTS
os.chdir("TTTS")
!pip install .
and then
!python examples/fastspeech/train_fastspeech.py
@MODAK27 Here is what you want, isn't it?
And also, we can easily remove the example folder from colab environment with the below code.
import examples !rm -r {'/'.join(examples.__file__.split('/')[:-1])} import os !git clone https://github.com/TensorSpeech/TensorflowTTS TTTS os.chdir("TTTS") !pip install .and then
!python examples/fastspeech/train_fastspeech.py@MODAK27 Here is what you want, isn't it?
yeah thanx sir for looking into the prob. I solved it. Sir one more help is req, to extract durations for alignment in Fastspeech2 , do we need to train tacotron2 model to get checkpoints/model-65000.h5
@MODAK27 you need train tacotron2 to extract duration on ur own dataset. If you train ljspeech, you can use our pretrained.
Most helpful comment
@MODAK27 you need train tacotron2 to extract duration on ur own dataset. If you train ljspeech, you can use our pretrained.