Skip to content

Add 'with EventStorage()' context #5446

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ostrowskimarcin
Copy link

Currently I'm using pytorch to test some models benchmarks with compile mode - https://github.com/pytorch/pytorch/tree/main/benchmarks/dynamo
When I run detectron2-* models following error appears:

storage = get_event_storage()
  File "/usr/local/lib/python3.10/dist-packages/detectron2/utils/events.py", line 34, in get_event_storage
    assert len(
AssertionError: get_event_storage() has to be called inside a 'with EventStorage(...)' context!

It seems that the code doesn't get the storage in a proper way. I added a context to each required place and it works for me.
I also noticed that this usage is present in other different places in repo but I left it as it is.
Could you take a look?

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 3, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants