Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion verl/utils/tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def __init__(self, project_name: str, experiment_name: str):
directory = os.path.join(root_path, self.project_name)
os.makedirs(directory, exist_ok=True)
self.filepath = os.path.join(directory, f"{self.experiment_name}.jsonl")
print(f"Creating file logger at {self.filepath}")
print(f"Creating file logger at {os.path.abspath(self.filepath)}")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

While this change correctly makes the log message more informative, it highlights a pre-existing critical bug. If VERL_FILE_LOGGER_PATH is set from the environment, the directory for the specified path is not created, as os.makedirs is only called when the path is generated by the program. This will lead to a FileNotFoundError on line 267 if the directory doesn't exist.

The directory for self.filepath should be created before the file is opened, regardless of how the path is specified. A possible fix is to call os.makedirs(os.path.dirname(self.filepath), exist_ok=True) after self.filepath is determined.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

While this change correctly makes the log message more informative, it highlights a pre-existing critical bug. If VERL_FILE_LOGGER_PATH is set from the environment, the directory for the specified path is not created, as os.makedirs is only called when the path is generated by the program. This will lead to a FileNotFoundError on line 267 if the directory doesn't exist.

The directory for self.filepath should be created before the file is opened, regardless of how the path is specified. A possible fix is to call os.makedirs(os.path.dirname(self.filepath), exist_ok=True) after self.filepath is determined.

Could you propose a fix

self.fp = open(self.filepath, "wb", buffering=0)

def log(self, data, step):
Expand Down
Loading