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

can't use elmo #20

Open
violet-hai opened this issue Nov 14, 2020 · 1 comment
Open

can't use elmo #20

violet-hai opened this issue Nov 14, 2020 · 1 comment

Comments

@violet-hai
Copy link

When i set --elmo to 1 , i have got an error.
I don’t know allennlp well, and it took a few days to still not be able to solve the following error. If anyone knows a solution, please leave me a message, thank you very much!

Traceback (most recent call last):
File "/home/GLUE-baselines-master/src/main.py", line 280, in
sys.exit(main(sys.argv[1:]))
File "/home/GLUE-baselines-master/src/main.py", line 177, in main
args.load_model)
File "/home/GLUE-baselines-master/src/trainer.py", line 240, in train
output_dict = self._forward(batch, task=task, for_training=True)
File "/home/GLUE-baselines-master/src/trainer.py", line 464, in _forward
return self._model.forward(task, **tensor_batch)
File "/home/GLUE-baselines-master/src/models.py", line 219, in forward
sent_emb = self.sent_encoder(input1)
File "/home/anaconda3/envs/glue/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in call
result = self.forward(*input, **kwargs)
File "/home/GLUE-baselines-master/src/models.py", line 413, in forward
sent_embs = self._highway_layer(self._text_field_embedder(sent))
File "/home/anaconda3/envs/glue/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in call
result = self.forward(*input, **kwargs)
File "/home/anaconda3/envs/glue/lib/python3.6/site-packages/allennlp/modules/text_field_embedders/basic_text_field_embedder.py", line 63, in forward
raise ConfigurationError(message)
allennlp.common.checks.ConfigurationError: "Mismatched token keys: dict_keys(['words']) and dict_keys(['elmo', 'words'])"

@W4ngatang
Copy link
Collaborator

W4ngatang commented Nov 16, 2020 via email

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