AI4Bharat/indicTrans

ImportError: cannot import name 'convert_namespace_to_omegaconf' from 'fairseq.dataclass.utils'

snehampatil opened this issue · 4 comments

I am trying to run the translation code in my IDE. The python code is placed under indicTrans folder.
The statement
from inference.engine import Model
throws an error :

  File "Run.py", line 1, in <module>  
    from inference.engine import Model  
  File "/home/sneha/Documents/indic/indicTrans/inference/engine.py", line 15, in <module>  
    from inference.custom_interactive import Translator  
  File "/home/sneha/Documents/indic/indicTrans/inference/custom_interactive.py", line 17, in <module>  
    from fairseq.dataclass.utils import convert_namespace_to_omegaconf  
ImportError: cannot import name 'convert_namespace_to_omegaconf' from 'fairseq.dataclass.utils' (/home/sneha/.local/lib/python3.8/site-packages/fairseq/dataclass/utils.py)

May I know how this can be solved ?
Thank you

@snehampatil ,
Which documentation are you following? Did you git clone fairseq?

I followed the installation steps mentioned in the Colab Notebook. And I have cloned the fairseq
git clone https://github.com/pytorch/fairseq.git

Sorry for the late reply.

I just tested our tutorial colab notebook with the latest fairseq and didn't face this error.
image

You can double-check the fairseq installation in your local(see if you have another old fairseq version that your python is using as default, etc) or help us with a reproducible colab script so that we can take a further look.

The issue has come back. Tested on the tutorial nb too. Can anyone help resolve it?