-
Notifications
You must be signed in to change notification settings - Fork 459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to import LaserEncoderPipeline #280
Comments
The suggestion given by ChatGPT is as follows :
|
@sumedhan-r can you please indicate the versions of fairseq and omegaconf that you are using, and the minimal code required to reproduce the problem? |
I am getting this error too. I was able to recreate it in Python 3.11 right from the import statement: My sense is that ChatGPT's suggestion is on the right track. Specifically, there are a number of statements toward the end of fairseq/dataclass/configs.py that assign a mutable type as a default. Assigning these using the pattern It appears the dubious pattern is still used through the latest version of fairseq, v0.12.2, which was released in 2022. |
@dpdeb @sumedhan-r can you please indicate the versions of When I am installing all packages from scratch (see this Colab notebook for repro), I get |
So, I have got the same error: raise ex # set end OC_CAUSE=1 for full backtrace I also changed classes fairseq\dataclass\configs.py and hydra\conf_init_.py to use default_factory and then received the error above. Has anyone come up with a fix? :) |
@TheHappyLemon how can I reproduce your error? |
@avidale from laser_encoders import LaserEncoderPipeline Initially, I thought I have to install newest versions of dependent package fairseq. But I just couldn`t install fairseq at all, because I was getting error: FileNotFoundError: [Errno 2] No such file or directory: 'VERSION.txt. There are multiple issues for this error, like skrub-data/skrub#476 I also tried to install it from local clone, but then I was getting errors described here facebookresearch/demucs#423 So I decided to abandon this idea and fix error with default_factory. I did fixes in miniconda3\Lib\site-packages\fairseq\dataclass\configs.py and in miniconda3\Lib\site-packages\hydra\conf_init_.py And then finally I received the error I commented. I have following packages versions (ran pip install laser_encoders to get this info): So I dont know what whould be the best way to reproduce. Maybe do a clean install? Idk :( |
I just created a new fresh virtual conda environment, ran pip install laser_encoders, succesfully installed following packages: Installing collected packages: tbb, sentencepiece, intel-openmp, bitarray, antlr4-python3-runtime, unicategories, portalocker, omegaconf, mkl, cython, torch, sacremoses, sacrebleu, hydra-core, torchaudio, fairseq, laser_encoders And after running
|
Error is reproduced on windows 11 with this environment: |
Apparently, Fairseq is not supporting Python 3.11 and newer versions; see e.g. facebookresearch/fairseq#5191. Thus, there are 3 possible solutions for you:
|
While calling LaserEncoderPipeline for the purpose of downstream NLP tasks, the first error that popped up was a ValueError, which stated
mutable default <class 'fairseq.dataclass.configs.CommonConfig'> for field common is not allowed: use default_factory
I asked the opinion of ChatGPT on the same and had got a code that slightly modified the line where the Config classes are declared.
After having made changes to all the respective Config related classes, I was getting another Error, namely ValidationError which stated
Object of unsupported type: '_MISSING_TYPE'
full_key:
reference_type=None
object_type=None
Below are attached some screenshots related to the errors. Please look into this at the earliest.
The text was updated successfully, but these errors were encountered: