ModuleNotFoundError: No module named 'TTS.utils.radam'

Hi,
I trained my own tacotron2 model.

while trying to load my pretrained tts model, I get below error:

python test.py

Using model: Tacotron2
Setting up Audio Processor…
| > bits:None
| > sample_rate:22050
| > num_mels:80
| > min_level_db:-100
| > frame_shift_ms:12.5
| > frame_length_ms:50
| > ref_level_db:20
| > num_freq:1025
| > power:1.5
| > preemphasis:0.98
| > griffin_lim_iters:60
| > signal_norm:True
| > symmetric_norm:False
| > mel_fmin:0.0
| > mel_fmax:8000.0
| > max_norm:1.0
| > clip_norm:True
| > do_trim_silence:True
| > n_fft:2048
| > hop_length:275
| > win_length:1102
Traceback (most recent call last):
File “test.py”, line 61, in
cp = torch.load(tts_pretrained_model)
File “/home/ubuntu/drive_a/mayank/Test/vin_test/lib/python3.6/site-packages/torch/serialization.py”, line 593, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File “/home/ubuntu/drive_a/mayank/Test/vin_test/lib/python3.6/site-packages/torch/serialization.py”, line 773, in _legacy_load
result = unpickler.load()
ModuleNotFoundError: No module named ‘TTS.utils.radam’

Hi @Vinay_Sharma - so others understand what you’ve done, please could you share details about how you installed it and which branch/commit you’re using

2 Likes

As @nmstoker doesn’t want to advertise it, I will. Use his excellent tool gatherup for the environment and give as stated info on commit/branch.

3 Likes

using gatherup, I got below details:

[Replace this text with comments]

Details

Platform OS

  • Linux

Python Environment

  • Python 3.6.12

  • Virtual env: Venv / virtualenv

Package Installation

  • TTS installed via Pip

Click to see package list (package count: 112)

:package: Package list from Pip

Package Version
absl-py 0.11.0
astroid 2.4.2
astunparse 1.6.3
attrdict 2.0.1
attrs 20.3.0
audioread 2.1.9
bokeh 1.4.0
cachetools 4.1.1
cardboardlint 1.3.0
certifi 2020.11.8
cffi 1.14.3
chardet 3.0.4
click 7.1.2
clldutils 3.5.4
colorama 0.4.4
colorlog 4.6.2
commonmark 0.9.1
confuse 1.3.0
csvw 1.8.1
cycler 0.10.0
Cython 0.29.21
dataclasses 0.7
decorator 4.4.2
filelock 3.0.12
Flask 1.1.2
future 0.18.2
gast 0.3.3
gatherup 0.0.4
gdown 3.12.2
google-auth 1.23.0
google-auth-oauthlib 0.4.2
google-pasta 0.2.0
grpcio 1.33.2
h5py 2.10.0
idna 2.10
importlib-metadata 3.1.0
importlib-resources 3.3.0
inflect 5.0.2
isodate 0.6.0
isort 4.3.21
itsdangerous 1.1.0
Jinja2 2.11.2
joblib 0.17.0
Keras-Preprocessing 1.1.2
kiwisolver 1.3.1
lazy-object-proxy 1.4.3
librosa 0.7.2
llvmlite 0.31.0
Markdown 3.3.3
MarkupSafe 1.1.1
matplotlib 3.3.3
mccabe 0.6.1
nose 1.3.7
numba 0.48.0
numpy 1.18.5
oauthlib 3.1.0
opt-einsum 3.3.0
packaging 20.4
phonemizer 2.2.1
Pillow 8.0.1
pip 20.3b1
pkg-resources 0.0.0
prompt-toolkit 3.0.8
protobuf 3.14.0
pyasn1 0.4.8
pyasn1-modules 0.2.8
pycparser 2.20
Pygments 2.7.2
pylint 2.5.3
pyparsing 2.4.7
pysbd 0.3.3
PySocks 1.7.1
python-dateutil 2.8.1
pyworld 0.2.12
PyYAML 5.3.1
questionary 1.8.1
regex 2020.11.13
requests 2.25.0
requests-oauthlib 1.3.0
resampy 0.2.2
rfc3986 1.4.0
rich 8.0.0
rsa 4.6
scikit-learn 0.23.2
scipy 1.5.4
segments 2.1.3
setuptools 50.3.2
six 1.15.0
SoundFile 0.10.3.post1
tabulate 0.8.7
tensorboard 2.4.0
tensorboard-plugin-wit 1.7.0
tensorboardX 2.1
tensorflow 2.3.1
tensorflow-estimator 2.3.0
termcolor 1.1.0
threadpoolctl 2.1.0
toml 0.10.2
torch 1.5.0
tornado 6.1
tqdm 4.53.0
typed-ast 1.4.1
typing-extensions 3.7.4.3
umap-learn 0.4.6
Unidecode 1.1.1
uritemplate 3.0.1
urllib3 1.26.2
wcwidth 0.2.5
Werkzeug 1.0.1
wheel 0.35.1
wrapt 1.12.1
zipp 3.4.0

- generated at 21:20 on Nov 24 2020 using Gather Up tool :gift:

I am taking help from below link to test tacotron2 trained on private dataset

https://colab.research.google.com/github/tugstugi/dl-colab-notebooks/blob/master/notebooks/Mozilla_TTS_WaveRNN.ipynb#scrollTo=Hx93hVb6Y8dA

Project: TTS
Branch: Tacotron2-iter-260K-824c091

Project: WaveRNN
Commit: 8a1c152

I set
tts_pretrained_model = ‘path/to/checkpoint_on_privatedataset.pth.tar’
in the above colab code.

I don’t see TTS listed in the modules you have installed, so it’s important you’re in the right folder when you run the code.

I’d take a look at that Colab to make sure you’re in the same relative location as the Colab (I’m assuming the Colab works currently when run from a fresh setup, right?)

1 Like