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

ModuleNotFoundError: No module named 'examples.data2vec' #3

Open
monalipb opened this issue Jun 28, 2024 · 1 comment
Open

ModuleNotFoundError: No module named 'examples.data2vec' #3

monalipb opened this issue Jun 28, 2024 · 1 comment

Comments

@monalipb
Copy link

I am getting this error while running this command

python3 infer.py model_path audio_path

I have successfully installed the Fairseq-Inference repository provided here and pip3 install --editable ./ also worked fine for me.

File "/home/ec2-user/SageMaker/fairseq_inference/infer.py", line 3, in <module>
    import fairseq
  File "/home/ec2-user/SageMaker/fairseq_inference/fairseq-0.12.2/fairseq/__init__.py", line 33, in <module>
    import fairseq.criterions  # noqa
  File "/home/ec2-user/SageMaker/fairseq_inference/fairseq-0.12.2/fairseq/criterions/__init__.py", line 36, in <module>
    importlib.import_module("fairseq.criterions." + file_name)
  File "/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/home/ec2-user/SageMaker/fairseq_inference/fairseq-0.12.2/fairseq/criterions/ctc.py", line 19, in <module>
    from fairseq.tasks import FairseqTask
  File "/home/ec2-user/SageMaker/fairseq_inference/fairseq-0.12.2/fairseq/tasks/__init__.py", line 136, in <module>
    import_tasks(tasks_dir, "fairseq.tasks")
  File "/home/ec2-user/SageMaker/fairseq_inference/fairseq-0.12.2/fairseq/tasks/__init__.py", line 117, in import_tasks
    importlib.import_module(namespace + "." + task_name)
  File "/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/home/ec2-user/SageMaker/fairseq_inference/fairseq-0.12.2/fairseq/tasks/online_backtranslation.py", line 34, in <module>
    from fairseq.sequence_generator import SequenceGenerator
  File "/home/ec2-user/SageMaker/fairseq_inference/fairseq-0.12.2/fairseq/sequence_generator.py", line 16, in <module>
    from fairseq.models import FairseqIncrementalDecoder
  File "/home/ec2-user/SageMaker/fairseq_inference/fairseq-0.12.2/fairseq/models/__init__.py", line 237, in <module>
    import_models(data2vec_dir, "examples.data2vec.models")
  File "/home/ec2-user/SageMaker/fairseq_inference/fairseq-0.12.2/fairseq/models/__init__.py", line 217, in import_models
    importlib.import_module(namespace + "." + model_name)
  File "/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named 'examples.data2vec
@rumourscape
Copy link

rumourscape commented Aug 27, 2024

Run python setup.py build develop to fix this.

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

2 participants