I just want to import python file with hyper parameters in the parent directory, but I just got the system error.
Parent module '' not loaded, cannot perform relative import
The directory structure is as below.
Project directory
+-- package
| +-- dataset
| | +-- __init__.py
| | +-- dataset.py
| +-- models
| +-- __init__.py
| +-- cnn.py
+-- __init__.py
+-- hparams.py
+-- main.py
What I want to do is import variables of hparams.py in dataset.py
I've tried several lines as below, but none of these works.
from ..hparams import *
from ...hparams import *
from .. import hparams
from ... import hparams
What should I do for import?