-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feature/100 separate log files #143
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, but we may wait for Seba to also review it
At the first glance this looks much more complicated than it should be. Please motivate why it was neccesarry |
art/art_logger.py
Outdated
from loguru import logger | ||
from pathlib import Path | ||
from art.paths import LOG_PATH | ||
logger.remove() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This just makes sure that default loguru handler is removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
art/art_logger.py
Outdated
from pathlib import Path | ||
from art.paths import LOG_PATH | ||
logger.remove() | ||
logger.add(sys.stdout, format="{message}", level="DEBUG", filter= lambda record: ('halt_exception' not in record['extra']) or (not record['extra']['halt_exception'])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This filter looks nice (It could even solve our lighnitng issue) but isn't it a big overhead to check in
for everything that goes into it? Why this is necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got rid of it
art/art_logger.py
Outdated
|
||
art_logger = logger | ||
|
||
if __name__ == "__main__": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is just for debugging purposes remove it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
art/art_logger.py
Outdated
yield | ||
return | ||
already_contextualized_logers.add(str(folder_path)) | ||
global logger_level |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be more number_of_loggers
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
art/art_logger.py
Outdated
try: | ||
with logger.contextualize(file=str(folder_path)): | ||
try: | ||
yield |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how one can obtain exception here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
art/paths.py
Outdated
|
||
CHECKPOINTS_PATH = Path("checkpoints") | ||
LOG_PATH = Path("logs") | ||
EXPERIMENT_LOG_PATH = CHECKPOINTS_PATH/"experiment"/"logs" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The structure is okay but root folder should be user defined. What if I want to run 2 or more experiments in one folder. All will be in the same place?
I mean we have this exp1
defined in our first tutorial
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
than it will be run in another folder so it will by in exp2
art/paths.py
Outdated
|
||
|
||
def get_checkpoint_step_dir_path(step_id: str, step_name: str) -> Path: | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this is taken out from jsonsavers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
@@ -54,11 +56,12 @@ def __call__( | |||
datamodule (L.LightningDataModule): Data module to be used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just wonder why can't we create custom logger here (we will have it's id), after everything is runned we can just remove it by id. We could generate random log name from tempfile library and link it to the results so log path will be available from json. With this we also have logs for every run stored
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done with uuid
Moreover it is very important for me to create new log file for every run of experiment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one change for me and it will be nice. Create UUID just once and all logs from one experiment run has the same name. Maybe some read only singleton?
Then we can easily reconstruct the entire experiment graph
art/paths.py
Outdated
|
||
CHECKPOINTS_PATH = Path("checkpoints") | ||
LOG_PATH = Path("logs") | ||
EXPERIMENT_LOG_PATH = CHECKPOINTS_PATH/"experiment"/"logs"/"logs.log" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this logs.log?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
corrected
test fix
redundant log path delete
No description provided.