inr-gan icon indicating copy to clipboard operation
inr-gan copied to clipboard

`ModuleNotFoundError` when importing modules in `src`.

Open shlee625 opened this issue 2 years ago • 2 comments

Hi. thank you for your great work.

As you intended, src/infra/launch_local.py changes the directory to experiments/my_experiment and trains the model. However, I encountered ModuleNotFoundError at line 24 and line 25 in src/training/training_loop.py. After I changed the lines, everything goes fine. The problem kept occurring even when I added experiments/my_experiment to sys.path. I wonder that this problem didn't occur in your case. Thanks again and stay safe.

Best Wishes, Lee

shlee625 avatar Aug 26 '21 09:08 shlee625

Hi, Lee! Could you please tell how exactly you change the lines 24 and 25? Do you change them by removing the src prefix? I.e., from:

import src.legacy
from src.metrics import metric_main

to:

import legacy
from metrics import metric_main

?

This looks like a problem with PYTHON_PATH. Does this problem occur when you launch the training via src/infra/launch_local.py or when you launch/relaunch it manually after the directory had been already created?

universome avatar Aug 27 '21 18:08 universome

Yes, it's correct. It occurs when I run the training via python src/infra/launch_local.py as in README.md.

shlee625 avatar Aug 30 '21 07:08 shlee625