Open VikasRajashekar opened 3 years ago
Hi, I am having the same error and would also appreciate some help! Thanks :)
Which tutorial/README did you follow? Can you share the exact command you ran, and also mention what version of fairseq you're using (0.10.1, master, ...)?
I got the same error when I follow the fairseq document tutorial,I download wmt16.en-de.joined-dict.transformer,and follow the instructions.But failded, same error.
the command I use is:
>MODEL_DIR=wmt16.en-de.joined-dict.transformer
>fairseq-interactive --path $MODEL_DIR/model.pt $MODEL_DIR --beam 5 --source-lang en --target-lang de --tokenizer moses --bpe subword_nmt --bpe-codes $MODEL_DIR/bpecodes
The fairseq version is 1.0.0a0+f13f299
the command I use is:
>MODEL_DIR=wmt16.en-de.joined-dict.transformer >fairseq-interactive --path $MODEL_DIR/model.pt $MODEL_DIR --beam 5 --source-lang en --target-lang de --tokenizer moses --bpe subword_nmt --bpe-codes $MODEL_DIR/bpecodes
The fairseq version is 1.0.0a0+f13f299
after I uninstalled master(1.0.0) version and installed v0.10.0, it works fine and no error
having the same error when using the master version and run
torch.hub.load('pytorch/fairseq', 'transformer.wmt14.en-fr',
checkpoint_file='model.pt',
tokenizer='moses', bpe='fastbpe')
but it works with other models such as transformer.wmt19.en-de
I manually set update_freq
to [1]
in fairseq/fairseq/checkpoint_utils.py
and it works:
def load_checkpoint_to_cpu(path, arg_overrides=None):
"""Loads a checkpoint to CPU (with upgrading for backward compatibility)."""
with open(PathManager.get_local_path(path), "rb") as f:
state = torch.load(f, map_location=torch.device("cpu"))
if "args" in state and state["args"] is not None and arg_overrides is not None:
args = state["args"]
for arg_name, arg_val in arg_overrides.items():
setattr(args, arg_name, arg_val)
if "cfg" in state and state["cfg"] is not None and arg_overrides is not None:
overwrite_args_by_name(state["cfg"], arg_overrides)
state['args'].update_freq = [1] # manually set to [1]
state = _upgrade_state_dict(state)
return state
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!
how to resolve this error:
I am just running the example code form your tutorial/Readme and I have set it up as you have given instructions.