facebookresearch / fairseq

Facebook AI Research Sequence-to-Sequence Toolkit written in Python.
MIT License
29.78k stars 6.3k forks source link

Importing `hydra.experimental` results with an ImportError #5450

Open SagiPolaczek opened 4 months ago

SagiPolaczek commented 4 months ago

Hey! Firstly, thanks for creating and maintaining the package!

In my project I use both fairseq & hydra (hydra-core) packages. Importing hydra's experimental components results with an ImportError while using hydra's version_base at least 1.2.

IMO, the problematic line in your code: https://github.com/facebookresearch/fairseq/blob/34973a94d09ecc12092a5ecc8afece5e536b7692/fairseq/dataclass/utils.py#L19

In my case, the ImportError in hydra-core is being raised here.

My suggestion in to remove the .experimental .

Thanks in advance!

brian316 commented 3 weeks ago

same issue here. have to manually remove to get it to work. maybe add it as

try:
    from hydra.experimental import compose, initialize
except ImportError:
    from hydra import compose, initialize