My folder structure:
ttsTacotron.py
Tacotron-2
|..
|tacotron|
|train.py
|synthetizer.py
|...
|synthesize.py # imports hparams.py
|hparams.py
...
When I call synthesize.py directly it works fine, all of its imports get processed successfully. When I import synthesize in the ttsTacotron.py and call it, it fails on importing synthesize's modules. Specifically, it fails on importing hparams.
ttsTacotron.py:
import fire
import sys
import os
import importlib
foobar = importlib.import_module("Tacotron-2.synthesize")
Tacotron folder in question is this repository but the issue is unlikely to be specific to it.
Remarks: I use importlib to handle having - in the subfolder. Can't really rename it for various reasons.
My goal: Be able to call synthetize's methods & be able to import tacotron modules from a script that is in the root folder.