Fairseq: Issue with fb_pathmgr

Created on 23 Oct 2019  路  10Comments  路  Source: pytorch/fairseq

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!

Most helpful comment

I'm still having this error with fairseq 0.9.0

All 10 comments

Same here, same error

same error

This should be fixed.

I'm still having this error with fairseq 0.9.0

same here

And same here.

And same here.

Still have the issue

@myleott I am having same issue. Anybody able to fix it or find a solution?

Same issue here @myleott

Was this page helpful?
0 / 5 - 0 ratings