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

[Enhancement] Add ability to pass logger instance to frameworks #2317

Merged
merged 3 commits into from
Oct 12, 2022
Merged

[Enhancement] Add ability to pass logger instance to frameworks #2317

merged 3 commits into from
Oct 12, 2022

Conversation

shcheklein
Copy link

@shcheklein shcheklein commented Oct 5, 2022

Motivation

Updating the DVCLive hook according the latest changes in the way we use loggers in DVCLive.

Modification

  • Added a way to pass a dvclive instance into the hook

Checklist

Before PR:

  • I have read and followed the workflow indicated in the CONTRIBUTING.md to create this PR.
  • Pre-commit or linting tools indicated in CONTRIBUTING.md are used to fix the potential lint issues.
  • Bug fixes are covered by unit tests, the case that causes the bug should be added in the unit tests.
  • New functionalities are covered by complete unit tests. If not, please add more unit test to ensure the correctness.
  • The documentation has been modified accordingly, including docstring or example tutorials.

After PR:

  • If the modification has potential influence on downstream or other related projects, this PR should be tested with some of those projects, like MMDet or MMCls.
  • CLA has been signed and all committers have signed the CLA in this PR.

@CLAassistant
Copy link

CLAassistant commented Oct 5, 2022

CLA assistant check
All committers have signed the CLA.

@shcheklein
Copy link
Author

flake8 fails for an unrelated reason I think:

Traceback (most recent call last):
  File "/home/circleci/.cache/pre-commit/repo_1dyxylu/py_env-python3.7/bin/flake8", line 8, in <module>
    sys.exit(main())
  File "/home/circleci/.cache/pre-commit/repo_1dyxylu/py_env-python3.7/lib/python3.7/site-packages/flake8/main/cli.py", line 22, in main
    app.run(argv)
  File "/home/circleci/.cache/pre-commit/repo_1dyxylu/py_env-python3.7/lib/python3.7/site-packages/flake8/main/application.py", line 360, in run
    self._run(argv)
  File "/home/circleci/.cache/pre-commit/repo_1dyxylu/py_env-python3.7/lib/python3.7/site-packages/flake8/main/application.py", line 347, in _run
    self.initialize(argv)
  File "/home/circleci/.cache/pre-commit/repo_1dyxylu/py_env-python3.7/lib/python3.7/site-packages/flake8/main/application.py", line 328, in initialize
    self.find_plugins(config_finder)
  File "/home/circleci/.cache/pre-commit/repo_1dyxylu/py_env-python3.7/lib/python3.7/site-packages/flake8/main/application.py", line 153, in find_plugins
    self.check_plugins = plugin_manager.Checkers(local_plugins.extension)
  File "/home/circleci/.cache/pre-commit/repo_1dyxylu/py_env-python3.7/lib/python3.7/site-packages/flake8/plugins/manager.py", line 357, in __init__
    self.namespace, local_plugins=local_plugins
  File "/home/circleci/.cache/pre-commit/repo_1dyxylu/py_env-python3.7/lib/python3.7/site-packages/flake8/plugins/manager.py", line 238, in __init__
    self._load_entrypoint_plugins()
  File "/home/circleci/.cache/pre-commit/repo_1dyxylu/py_env-python3.7/lib/python3.7/site-packages/flake8/plugins/manager.py", line 254, in _load_entrypoint_plugins
    eps = importlib_metadata.entry_points().get(self.namespace, ())
AttributeError: 'EntryPoints' object has no attribute 'get'

PyCQA/flake8#1701

@zhouzaida
Copy link
Collaborator

zhouzaida commented Oct 7, 2022

Hi @shcheklein , The reason flake8 failed is that importlib-metadata released v5.0.0 which removed deprecated endpoint. More details at https://stackoverflow.com/questions/73929564/entrypoints-object-has-no-attribute-get-digital-ocean/73932581#73932581. I will submit a PR to fix the error.

@shcheklein
Copy link
Author

Thanks @zhouzaida !

@zhouzaida zhouzaida mentioned this pull request Oct 7, 2022
7 tasks
@shcheklein
Copy link
Author

@zhouzaida thanks for the pre-commit and linters update. I've rebased the branch. I think you need to approve CI to run?

@zhouzaida zhouzaida changed the title Add ability to pass logger instance to frameworks [Enhancement] Add ability to pass logger instance to frameworks Oct 12, 2022
@zhouzaida zhouzaida merged commit e417035 into open-mmlab:master Oct 12, 2022
cathyzhang222 pushed a commit to cathyzhang222/mmcv that referenced this pull request Oct 20, 2022
…-mmlab#2317)

* Add ability to pass logger instance to frameworks

* refine docstring

* Update mmcv/runner/hooks/logger/dvclive.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
cathyzhang222 pushed a commit to cathyzhang222/mmcv that referenced this pull request Oct 20, 2022
…-mmlab#2317)

* Add ability to pass logger instance to frameworks

* refine docstring

* Update mmcv/runner/hooks/logger/dvclive.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
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.

4 participants