Resetting the state of GlobalHydra

See original GitHub issue

Hi,

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:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
imilascommented, Jun 6, 2022

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()

4reactions
chrdillercommented, Feb 25, 2020

Ah cool. Had some trouble finding how to actually call this; in the end, hydra._internal.hydra.GlobalHydra.get_state().clear() worked.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found