Skip to content
This repository was archived by the owner on Mar 20, 2026. It is now read-only.
This repository was archived by the owner on Mar 20, 2026. It is now read-only.

Model File Not Found #990

@SreeramV181

Description

@SreeramV181

When I try to load the english to german and german to english pretrained models as follows

en2de = torch.hub.load('pytorch/fairseq', 'transformer.wmt19.en-de', tokenizer='moses', bpe='subword_nmt', force_reload=True)
de2en = torch.hub.load('pytorch/fairseq', 'transformer.wmt19.de-en', tokenizer='moses', bpe='subword_nmt', force_reload=True)

I get the following error:


OSError Traceback (most recent call last)
in
----> 1 en2ru = torch.hub.load('pytorch/fairseq', 'transformer.wmt19.en-de', tokenizer='moses', bpe='subword_nmt', force_reload=True)
2 ru2en = torch.hub.load('pytorch/fairseq', 'transformer.wmt19.de-en', tokenizer='moses', bpe='subword_nmt', force_reload=True)

/opt/anaconda3/lib/python3.7/site-packages/torch/hub.py in load(github, model, *args, **kwargs)
338 entry = _load_entry_from_hubconf(hub_module, model)
339
--> 340 model = entry(*args, **kwargs)
341
342 sys.path.remove(repo_dir)

~/.cache/torch/hub/pytorch_fairseq_master/fairseq/models/fairseq_model.py in from_pretrained(cls, model_name_or_path, checkpoint_file, data_name_or_path, **kwargs)
171 data_name_or_path,
172 archive_map=cls.hub_models(),
--> 173 **kwargs,
174 )
175 print(x['args'])

~/.cache/torch/hub/pytorch_fairseq_master/fairseq/hub_utils.py in from_pretrained(model_name_or_path, checkpoint_file, data_name_or_path, archive_map, **kwargs)
50 models, args, task = checkpoint_utils.load_model_ensemble_and_task(
51 [os.path.join(model_path, cpt) for cpt in checkpoint_file.split(':')],
---> 52 arg_overrides=kwargs,
53 )
54

~/.cache/torch/hub/pytorch_fairseq_master/fairseq/checkpoint_utils.py in load_model_ensemble_and_task(filenames, arg_overrides, task)
164 for filename in filenames:
165 if not os.path.exists(filename):
--> 166 raise IOError('Model file not found: {}'.format(filename))
167 state = load_checkpoint_to_cpu(filename, arg_overrides)
168

OSError: Model file not found: /home/sreeramchandrav/.cache/torch/pytorch_fairseq/0695ef328ddefcb8cbcfabc3196182f59c0e41e0468b10cc0db2ae9c91881fcc.bb1be17de4233e13870bd7d6065bfdb03fca0a51dd0f5d0b7edf5c188eda71f1/model.pt

What should i do to fix this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions