question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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