Resetting the state of GlobalHydra
See original GitHub issueHi,
I am trying to use the pytorch bottleneck profiler (python -m torch.utils.bottleneck train.py
) which apparently has to run the hydra-decorated main() function twice and results in the error
AssertionError: GlobalHydra is already initialized
Is there a way to reset the state of the GlobalHydra singleton manually or another workaround to make the profiler work with hydra?
Thanks
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Tutorial: Learning Hydra for configuring ML experiments
... and at any point we need to reinitialize it, we can reset its internal state: hydra.core.global_hydra.GlobalHydra.instance().clear() ...
Read more >useResetRecoilState(state)
Returns a function that will reset the value of the given state to its default value. Using useResetRecoilState() allows a component to reset...
Read more >How Al Qaeda Morphed into a Deadly Global Hydra
A new map of terrorist activity shows how al Qaeda has morphed from a centralized group in Afghanistan to a series of small,...
Read more >How to reset state - Zustand Documentation
The following pattern can be used to reset the state to its initial value. import create from 'zustand' // define types for state...
Read more >Draining development?
... of Dirty Money in Developing Countries: Tripping Up on the Global Hydra ... IN MOBILIZING AND DEVELOPING DOMESTIC FINANCIAL RESOURCES OF THE...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I ended up here while trying to run hydra (version 1.2.0) inside jupyter notebook. The function that worked for me is:
hydra.core.global_hydra.GlobalHydra.instance().clear()
Ah cool. Had some trouble finding how to actually call this; in the end,
hydra._internal.hydra.GlobalHydra.get_state().clear()
worked.