facebookresearch / hydra

Hydra is a framework for elegantly configuring complex applications
https://hydra.cc
MIT License
8.85k stars 639 forks source link

[Bug] hydra.errors.InstantiationException: Error in call to target 'hydra_plugins.hydra_ax_sweeper.ax_sweeper.AxSweeper': #2813

Open juliusaka opened 1 year ago

juliusaka commented 1 year ago

šŸ› Bug

Description

When I want to run the ax sweeper tutorial with the banana.py function on windows, I got when running

python banana.py -m 'banana.x=int(interval(-5, 5))' 'banana.y=interval(-5, 10.1)'

hydra.errors.InstantiationException: Error in call to target 'hydra_plugins.hydra_ax_sweeper.ax_sweeper.AxSweeper': ImportError("cannot import name '_mul_broadcast_shape' from 'gpytorch.utils.broadcasting' (C:\\Users\\JuliusAka\\miniconda3\\envs\\thesis_aka\\lib\\site-packages\\gpytorch\\utils\\broadcasting.py)") full_key: hydra.sweeper

downgrading gpytorch to version 1.8.0 or lower helped. However, if I run the same, I then get

ArgumentError('Type annotation for "SQAGeneratorRun.arms" can\'t be correctly interpreted for Annotated Declarative Table form. ORM annotations should normally make use of the ``Mapped[]`` generic type, or other ORM-compatible generic type, as a container for the actual type, which indicates the intent that the attribute is mapped. Class variables that are not intended to be mapped by the ORM should use ClassVar[]. To allow Annotated Declarative to disregard legacy annotations which don\'t use Mapped[] to pass, set "__allow_unmapped__ = True" on the class or a superclass this class.') full_key: hydra.sweeper

Checklist

To reproduce

Minimal Code/Config snippet to reproduce

python banana.py -m 'banana.x=int(interval(-5, 5))' 'banana.y=interval(-5, 10.1)'

Stack trace/error message

`ArgumentError('Type annotation for "SQAGeneratorRun.arms" can\'t be correctly interpreted for Annotated Declarative Table form.  ORM annotations should normally make use of the ``Mapped[]`` generic type, or other ORM-compatible generic type, as a container for the actual type, which indicates the intent that the attribute is mapped. Class variables that are not intended to be mapped by the ORM should use ClassVar[].  To allow Annotated Declarative to disregard legacy annotations which don\'t use Mapped[] to pass, set "__allow_unmapped__ = True" on the class or 
a superclass this class.')
full_key: hydra.sweeper

System information

odelalleau commented 1 year ago

Thanks for the report, I'm afraid that plugins may not be properly maintained currently.

juliusaka commented 1 year ago

I found the solution to this problem: just install ax

conda install ax-plattform

Then it works. Maybe that should be pointed out in the tutorial?

odelalleau commented 1 year ago

Ah! Yes feel free to submit a PR, thanks!

ga92xug commented 9 months ago

The second bug is actually also a known error (https://github.com/facebook/Ax/issues/1697#issuecomment-1624400271). Downgrading to SQLAlchemy version 1.* should do the trick. E.g. pip3 install SQLAlchemy==1.4.49

Should I submit a PR? I would be happy to do so.

marios1861 commented 5 months ago

Is there a fix for this? I can't get any requirements combination or conda environment file to consistently work.