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.

[Bug] Hydra fails to instantiate objects in specific cases

See original GitHub issue

🐛 Bug

Hydra fails to instantiate when the caller expects an arg called params and the value is not a supported primitive type.

To reproduce

https://colab.research.google.com/drive/16jOM9kKwSpu1DdUcJETMe6LOz0G9Gnqh?usp=sharing

** Stack trace/error message **

UnsupportedValueType: Value 'Parameter' is not a supported primitive type
	full_key: params[0]
	reference_type=Optional[List[Any]]
	object_type=list

Expected Behavior

No Exception

System information

  • Hydra Version : 1.0.0rc1
  • Python version : 3.7
  • Virtual environment type and version : NA
  • Operating system : Ubuntu

Additional context

NA

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:13 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
shagunsodhanicommented, Jun 29, 2020

@omry I do not have access to the colab notebooks. I have sent the request for access 😃

1reaction
omrycommented, Jun 27, 2020

@shagunsodhani : in your collab, this works:

optimizer = hydra.utils.instantiate(config, params=net.parameters())

Did you try this? this seems like an obvious way to do it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Instantiating objects with Hydra
The code using the instantiated object only knows the interface which remains constant, but the behavior is determined by the actual object instance....
Read more >
Hydra - Cannot override value in instantiate
I am trying to instantiate a Pytorch dataset object using hydra instantiate, overriding the default cfg value with the DictConfig object.
Read more >
Hydra Methods
@param {object} config - configuration object containing hydra specific keys/values * @return ... @throws Throws an error if this machine isn't a instance....
Read more >
Complete tutorial on how to use Hydra in Machine ...
Configuration can be specified or overridden from the command line; Dynamic command line tab completion; Run your application locally or launch ...
Read more >
HTTP API documentation
Ory Hydra HTTP API documentation. ... Create a new OAuth 2.0 client. ... In the case of authentication error, a WWW-Authenticate header ...
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