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

Reduce logging for Keras #124

Merged
merged 5 commits into from
May 31, 2024
Merged

Reduce logging for Keras #124

merged 5 commits into from
May 31, 2024

Conversation

neshdev
Copy link
Member

@neshdev neshdev commented May 23, 2024

  • Moved logging statement to reduce console output.
  • Hitting the cache will no longer produce "Downloading from ..."

https://b.corp.google.com/issues/338419689

@neshdev neshdev requested a review from rosbo May 23, 2024 14:12
@rosbo
Copy link
Contributor

rosbo commented May 23, 2024

@neshdev Can you do the same for the KaggleCacheResolver to reduce log spamming when running inside a Kaggle notebook. This client is only used outside Kaggle Notebook.

logger.info(f"Attaching '{path}' from model '{h}' to your Kaggle notebook...")
else:
logger.info(f"Attaching model '{h}' to your Kaggle notebook...")

@@ -39,9 +40,11 @@ def __call__(self, h: ModelHandle, path: Optional[str] = None, *, force_download
logger.warning("Ignoring invalid input: force_download flag cannot be used in a Kaggle notebook")

if path:
logger.info(f"Attaching '{path}' from model '{h}' to your Kaggle notebook...")
logger.info(
f"Attaching '{path}' from model '{h}' to your Kaggle notebook...", extra={**EXTRA_CONSOLE_BLOCK}
Copy link
Member Author

Choose a reason for hiding this comment

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

@rosbo - Should I block it from showing up in the console, or do you want me to move it down after making the call. If its the latter, I think I would need to keep track of the state.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it is useful to show in the console if the file is not mounted:

if os.path.exists(cached_path) : // already mounted, print to log file only
else: // not yet mounted, print to console too.

@neshdev neshdev merged commit 33198f7 into main May 31, 2024
7 checks passed
@neshdev neshdev deleted the neshdev/keras-log branch May 31, 2024 18:30
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.

2 participants