Skip to content
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

Fairseq metrics fails to load : cannot load the model. #4

Closed
gg4u opened this issue Apr 12, 2023 · 4 comments
Closed

Fairseq metrics fails to load : cannot load the model. #4

gg4u opened this issue Apr 12, 2023 · 4 comments

Comments

@gg4u
Copy link

gg4u commented Apr 12, 2023

Hi @mhagiwara, I successfully installed fairseq-0.12.2, but jupyter lab cannot loading it.

Have you met this issue ?
Could you help? I am trying to use the classifier demo.

I tried to install fairseq as per instruction, but having issue in loading:
import fairseq.checkpoint_utils

ImportError: cannot import name 'metrics' from 'fairseq' (unknown location)

I tried here :
OFA-Sys/OFA#305

but no success.

Screenshot 2023-04-13 at 1 05 16 AM

@ciaua
Copy link
Member

ciaua commented Apr 13, 2023

I also had some problem with the fairseq version specified in the instruction, but installing with pip worked for me.
That is: pip install fairseq
Could you remove the installed fairseq and install it with pip and see if this solves your problems?

@gg4u
Copy link
Author

gg4u commented Apr 15, 2023

Hi @ciaua thanks a lot for your help.
Unfortunately it does not work for me:

I tried:
pip install fairseq --no-cache-dir to ensure it will install from the internet and not from the cached version,
but no success:

from fairseq import metrics # fail ImportError: cannot import name 'metrics' from 'fairseq' (unknown location)
import fairseq.checkpoint_utils # ImportError: cannot import name 'metrics' from 'fairseq' (unknown location)

Screenshot 2023-04-15 at 2 09 52 AM

@ciaua
Copy link
Member

ciaua commented May 12, 2023

We have ported the pretrained models to TorchAudio and Onnx from the original fairseq models: https://github.com/earthspecies/aves#ported-versions

You can try if this solves the fairseq dependency issue. However, you will need to install torchaudio or onnxruntime

@mhagiwara
Copy link
Member

Hi @gg4u @ciaua Sorry for not responding earlier. Seems like the issue is that if you install fairseq right under your working directory your import gets confused and may encounter import issues. I suggest installing fairseq under a sibling (or totally unrelated) directory. I updated README to make this point clear. Thanks for pointing this out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants