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

Fixing log issue for Label Model #1652

Merged
merged 9 commits into from
Aug 5, 2021
Merged

Conversation

anerirana
Copy link
Contributor

@anerirana anerirana commented Jul 3, 2021

Description of proposed changes

Changing log level to INFO when verbose is set to True in LabelModel.fit()

Related issue(s)

Fixes #1638

Test plan

No new test cases are required

Checklist

Need help on these? Just ask!

  • I have read the CONTRIBUTING document.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • I have run tox -e complex and/or tox -e spark if appropriate.
  • All new and existing tests passed.

@anerirana
Copy link
Contributor Author

@bhancock8, I have made the discussed changes. But, the pipeline is failing at the build stage for python3.6, as the tox command does not complete in 15 minutes Travis wait time. Can you please suggest a way forward for this? Thank you.

@@ -622,6 +622,8 @@ def _execute_logging(self, loss: torch.Tensor) -> Metrics:

def _set_logger(self) -> None:
self.logger = Logger(self.train_config.log_freq)
if self.config.verbose:
logging.basicConfig(level=logging.INFO)
Copy link
Member

Choose a reason for hiding this comment

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

This appears to be changing the default logging the logging module, not for this specific class's logger. Can you modify just the logging level of self.logger instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did consider this. But, the logging has been implemented throughout the code at the root level. The logging inside fit() of LabelModel and log() of Logger are using module level logging function logging.info(). Therefore all the logs are generated by root level logger and the only way to set log level for LabelModel specifically is to change the CustomeLogger significantly. However, I don't think that is necessary. Even if I change the root logger level to INFO, it would not interfere with the logging flow. Because, before creating an INFO level log, there will always be a check for the verbose parameter.

Copy link
Member

Choose a reason for hiding this comment

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

I see. Alright, this looks good to me then!

@bhancock8 bhancock8 self-requested a review July 5, 2021 21:30
@bhancock8
Copy link
Member

Thanks for the PR! We'll take a look into why the Python 3.6 unit tests are getting stuck, as it appears to be unrelated to this PR.

@anerirana
Copy link
Contributor Author

Thanks @bhancock8, please merge the PR as well, because I don't have write access.

@bhancock8
Copy link
Member

Yep! I'll make sure this gets merged once the unit test build issue is resolved. Thanks @anerirana!

@bhancock8 bhancock8 merged commit 1ea1bbe into snorkel-team:master Aug 5, 2021
akode pushed a commit to akode/snorkel that referenced this pull request Jun 10, 2022
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

Successfully merging this pull request may close these issues.

LabelModel.fit() Not Showing Output in Jupyter Notebook/Jupyterlab Cell
2 participants