jbarrow / allennlp_tutorial

Tutorial on how to use AllenNLP for sequence modeling (including hierarchical LSTMs and CRF decoding)
MIT License
85 stars 18 forks source link

There is a bug in the configs/train_lstm.jsonnet file #18

Open Diison opened 3 years ago

Diison commented 3 years ago

command:

allennlp train -f --include-package tagging -s /tmp/tagging/lstm configs/train_lstm.jsonnet

ERROR:

2021-03-02 12:25:12,430 - INFO - allennlp.modules.token_embedders.embedding - Reading pretrained embeddings from file 2021-03-02 12:25:13,722 - INFO - allennlp.common.file_utils - cache of http://nlp.stanford.edu/data/glove.6B.zip is up-to-date 2021-03-02 12:25:14,726 - INFO - allennlp.common.file_utils - cache of http://nlp.stanford.edu/data/glove.6B.zip is up-to-date 400000it [00:02, 149772.39it/s] 2021-03-02 12:25:17,402 - CRITICAL - root - Uncaught exception Traceback (most recent call last): File "/home/s2020017/Anaconda_3.7/envs/owl2vec3/bin/allennlp", line 8, in sys.exit(run())
File "/home/s2020017/Anaconda_3.7/envs/owl2vec3/lib/python3.7/site-packages/allennlp/main.py", line 34, in run main(prog="allennlp") File "/home/s2020017/Anaconda_3.7/envs/owl2vec3/lib/python3.7/site-packages/allennlp/commands/init.py", line 119, in main args.func(args)
File "/home/s2020017/Anaconda_3.7/envs/owl2vec3/lib/python3.7/site-packages/allennlp/commands/train.py", line 119, in train_model_from_args file_friendly_logging=args.file_friendly_logging, File "/home/s2020017/Anaconda_3.7/envs/owl2vec3/lib/python3.7/site-packages/allennlp/commands/train.py", line 178, in train_model_from_file file_friendly_logging=file_friendly_logging, File "/home/s2020017/Anaconda_3.7/envs/owl2vec3/lib/python3.7/site-packages/allennlp/commands/train.py", line 242, in train_model file_friendly_logging=file_friendly_logging, File "/home/s2020017/Anaconda_3.7/envs/owl2vec3/lib/python3.7/site-packages/allennlp/commands/train.py", line 456, in _train_worker local_rank=process_rank, File "/home/s2020017/Anaconda_3.7/envs/owl2vec3/lib/python3.7/site-packages/allennlp/common/from_params.py", line 604, in from_params extras, File "/home/s2020017/Anaconda_3.7/envs/owl2vec3/lib/python3.7/site-packages/allennlp/common/from_params.py", line 634, in from_params return constructor_to_call(kwargs) # type: ignore File "/home/s2020017/Anaconda_3.7/envs/owl2vec3/lib/python3.7/site-packages/allennlp/commands/train.py", line 712, in from_partialobjects model = model.construct(vocab=vocabulary_, serialization_dir=serialization_dir) File "/home/s2020017/Anaconda_3.7/envs/owl2vec3/lib/python3.7/site-packages/allennlp/common/lazy.py", line 62, in construct return self._constructor(kwargs) File "/home/s2020017/Anaconda_3.7/envs/owl2vec3/lib/python3.7/site-packages/allennlp/common/from_params.py", line 470, in constructor return value_cls.from_params(params=deepcopy(popped_params), constructor_extras) File "/home/s2020017/Anaconda_3.7/envs/owl2vec3/lib/python3.7/site-packages/allennlp/common/from_params.py", line 604, in from_params extras, File "/home/s2020017/Anaconda_3.7/envs/owl2vec3/lib/python3.7/site-packages/allennlp/common/from_params.py", line 632, in from_params kwargs = create_kwargs(constructor_to_inspect, cls, params, extras) File "/home/s2020017/Anaconda_3.7/envs/owl2vec3/lib/python3.7/site-packages/allennlp/common/from_params.py", line 200, in create_kwargs cls.name, param_name, annotation, param.default, params, extras File "/home/s2020017/Anaconda_3.7/envs/owl2vec3/lib/python3.7/site-packages/allennlp/common/from_params.py", line 307, in pop_and_construct_arg return construct_arg(class_name, name, popped_params, annotation, default, extras) File "/home/s2020017/Anaconda_3.7/envs/owl2vec3/lib/python3.7/site-packages/allennlp/common/from_params.py", line 341, in construct_arg return annotation.from_params(params=popped_params, subextras) File "/home/s2020017/Anaconda_3.7/envs/owl2vec3/lib/python3.7/site-packages/allennlp/common/from_params.py", line 604, in from_params extras, File "/home/s2020017/Anaconda_3.7/envs/owl2vec3/lib/python3.7/site-packages/allennlp/common/from_params.py", line 632, in from_params kwargs = create_kwargs(constructor_to_inspect, cls, params, extras) File "/home/s2020017/Anaconda_3.7/envs/owl2vec3/lib/python3.7/site-packages/allennlp/common/from_params.py", line 200, in create_kwargs cls.name, param_name, annotation, param.default, params, extras File "/home/s2020017/Anaconda_3.7/envs/owl2vec3/lib/python3.7/site-packages/allennlp/common/from_params.py", line 307, in pop_and_construct_arg return construct_arg(class_name, name, popped_params, annotation, default, extras) File "/home/s2020017/Anaconda_3.7/envs/owl2vec3/lib/python3.7/site-packages/allennlp/common/from_params.py", line 391, in construct_arg extras, File "/home/s2020017/Anaconda_3.7/envs/owl2vec3/lib/python3.7/site-packages/allennlp/common/from_params.py", line 341, in construct_arg return annotation.from_params(params=popped_params, subextras) File "/home/s2020017/Anaconda_3.7/envs/owl2vec3/lib/python3.7/site-packages/allennlp/common/from_params.py", line 604, in from_params extras, File "/home/s2020017/Anaconda_3.7/envs/owl2vec3/lib/python3.7/site-packages/allennlp/common/from_params.py", line 634, in from_params return constructor_to_call(**kwargs) # type: ignore File "/home/s2020017/Anaconda_3.7/envs/owl2vec3/lib/python3.7/site-packages/allennlp/modules/token_embedders/embedding.py", line 156, in init pretrained_file, embedding_dim, vocab, vocab_namespace File "/home/s2020017/Anaconda_3.7/envs/owl2vec3/lib/python3.7/site-packages/allennlp/modules/token_embedders/embedding.py", line 370, in _read_pretrained_embeddings_file return _read_embeddings_from_text_file(file_uri, embedding_dim, vocab, namespace) File "/home/s2020017/Anaconda_3.7/envs/owl2vec3/lib/python3.7/site-packages/allennlp/modules/token_embedders/embedding.py", line 418, in _read_embeddings_from_text_file "No embeddings of correct dimension found; you probably " allennlp.common.checks.ConfigurationError: No embeddings of correct dimension found; you probably misspecified your embedding_dim parameter, or didn't pre-populate your Vocabulary

urieli commented 2 years ago

I got the same error when running against allennlp v2.9.3.

Fixed it with the following PR #19