question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue with fb_pathmgr

See original GitHub issue

Hello, I am running the interactive translation (via PyTorch Hub) example.

When I run the command en2de = torch.hub.load('pytorch/fairseq', 'transformer.wmt16.en-de', tokenizer='moses', bpe='subword_nmt')

I am getting the following error:

File "torch/hub/pytorch_fairseq_master/fairseq/checkpoint_utils.py", line 140, in load_checkpoint_to_cpu
    from fairseq.fb_pathmgr import fb_pathmgr
ImportError: No module named 'fairseq.fb_pathmgr'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/lib/python3.5/site-packages/torch/hub.py", line 363, in load
    model = entry(*args, **kwargs)
  File "torch/hub/pytorch_fairseq_master/fairseq/models/fairseq_model.py", line 172, in from_pretrained
    **kwargs,
  File "torch/hub/pytorch_fairseq_master/fairseq/hub_utils.py", line 54, in from_pretrained
    arg_overrides=kwargs,
  File "torch/hub/pytorch_fairseq_master/fairseq/checkpoint_utils.py", line 178, in load_model_ensemble_and_task
    state = load_checkpoint_to_cpu(filename, arg_overrides)
  File "torch/hub/pytorch_fairseq_master/fairseq/checkpoint_utils.py", line 145, in load_checkpoint_to_cpu
    except (ModuleNotFoundError, ImportError):
NameError: name 'ModuleNotFoundError' is not defined

Can you please help me resolve this?

Thanks!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

14reactions
yfeng21commented, Feb 27, 2020

I’m still having this error with fairseq 0.9.0

0reactions
fkjsleecommented, Jan 1, 2022

same error for both 0.8.0 and 0.10.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found