Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError when importing modules in src. #12

Open
shlee625 opened this issue Aug 26, 2021 · 2 comments
Open

ModuleNotFoundError when importing modules in src. #12

shlee625 opened this issue Aug 26, 2021 · 2 comments

Comments

@shlee625
Copy link

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

@universome
Copy link
Owner

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?

@shlee625
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants