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

Fix custom callbacks dirpath to be the same as default root dir #2194

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

CarlosNacher
Copy link
Contributor

@CarlosNacher CarlosNacher commented Jul 17, 2024

📝 Description

✨ Changes

Select what type of change your PR is:

  • 🐞 Bug fix (non-breaking change which fixes an issue)
  • 🔨 Refactor (non-breaking change which refactors the code base)
  • 🚀 New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🔒 Security update

✅ Checklist

Before you submit your pull request, please make sure you have completed the following steps:

  • 📋 I have summarized my changes in the CHANGELOG and followed the guidelines for my type of change (skip for minor changes, documentation updates, and test enhancements).
  • 📚 I have made the necessary updates to the documentation (if applicable).
  • 🧪 I have written tests that support my changes and prove that my fix is effective or my feature works (if applicable).

For more information about code review checklists, see the Code Review Checklist.

# (which was updated in _setup_workspace() method)
for cached_callback in self._cache.args["callbacks"]:
if hasattr(cached_callback, "dirpath"):
callback_dirpath = Path(cached_callback.dirpath)
Copy link
Contributor

Choose a reason for hiding this comment

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

is dirpath always the correct/fixed argument name for custom callbacks? If not, this approach may not work I'm afraid.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@samet-akcay I am not sure if I have correctly understood your concern correcty.
That chunk of code will work with all callbacks that have a dirpath argument. If not, it won't modify anything.
So, do all callbacks which need to be locally logged name its "dirpath_" argument dirpath? I don't know, but in lightning's callbacks docs there is only a callback (ModelCheckpoint) which has to be logged and has the dirpath argument.

Please, let me know if you think I misunderstood your question because I don't know if we are talking about the same concern.

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.

[Bug]: Custom Callbacks are not being logged in default_root_dir since anomalib V1
2 participants