sebastian-hofstaetter / matchmaker

Training & evaluation library for text-based neural re-ranking and dense retrieval models built with PyTorch
https://neural-ir-explorer.ec.tuwien.ac.at/
Apache License 2.0
261 stars 30 forks source link

allennlp.data.data_loaders.multiprocess_data_loader.WorkerError: worker raised ValueError("TextField's token_indexers have not been set.\nDid you forget to call DatasetReader.apply_token_indexers(instance) on your instance?\nIf apply_token_indexers() is being called but you're still seeing this error, it may not be implemented correctly.") #13

Open haiahaiah opened 3 years ago

haiahaiah commented 3 years ago

Hi, I'm running the TK model on msmarco-passage dataset. And when it starts to validate the model after 4000 steps, it show error like follows:

2021-07-20 17:23:02,579 INFO [eval_model] --- Start validation from loader 2021-07-20 17:23:03,006 INFO ----------------------------------------------------------------------------------------- 2021-07-20 17:23:03,009 ERROR [eval_model] Got exception: Traceback (most recent call last): File "/home/nfs3/yuhai09/query_doc/code/matchmaker/matchmaker/eval.py", line 82, in evaluate_model for batch_orig in input_loader: File "/home/nfs3/yuhai09/anaconda3/envs/matchmaker/lib/python3.8/site-packages/allennlp/data/data_loaders/multiprocess_data_loader.py", line 335, in iter yield from self._iter_batches() File "/home/nfs3/yuhai09/anaconda3/envs/matchmaker/lib/python3.8/site-packages/allennlp/data/data_loaders/multiprocess_data_loader.py", line 417, in _iter_batches raise WorkerError(e, tb) allennlp.data.data_loaders.multiprocess_data_loader.WorkerError: worker raised ValueError("TextField's token_indexers have not been set.\nDid you forget to call DatasetReader.apply_token_indexers(instance) on your instance?\nIf apply_token_indexers() is being called but you're still seeing this error, it may not be implemented correctly.") Traceback from worker: File "/home/nfs3/yuhai09/anaconda3/envs/matchmaker/lib/python3.8/site-packages/allennlp/data/data_loaders/multiprocess_data_loader.py", line 502, in _batch_worker for batch in self._instances_to_batches( File "/home/nfs3/yuhai09/anaconda3/envs/matchmaker/lib/python3.8/site-packages/allennlp/data/data_loaders/multiprocess_data_loader.py", line 556, in _instances_to_batches for instances in instance_chunks: File "/home/nfs3/yuhai09/anaconda3/envs/matchmaker/lib/python3.8/site-packages/allennlp/common/util.py", line 140, in lazy_groups_of s = list(islice(iterator, group_size)) File "/home/nfs3/yuhai09/anaconda3/envs/matchmaker/lib/python3.8/site-packages/allennlp/data/data_loaders/multiprocess_data_loader.py", line 539, in instance_iterator = (self._index_instance(instance) for instance in instance_iterator) File "/home/nfs3/yuhai09/anaconda3/envs/matchmaker/lib/python3.8/site-packages/allennlp/data/data_loaders/multiprocess_data_loader.py", line 533, in _index_instance instance.index_fields(self._vocab) File "/home/nfs3/yuhai09/anaconda3/envs/matchmaker/lib/python3.8/site-packages/allennlp/data/instance.py", line 75, in index_fields field.index(vocab) File "/home/nfs3/yuhai09/anaconda3/envs/matchmaker/lib/python3.8/site-packages/allennlp/data/fields/text_field.py", line 85, in index for indexer_name, indexer in self.token_indexers.items(): File "/home/nfs3/yuhai09/anaconda3/envs/matchmaker/lib/python3.8/site-packages/allennlp/data/fields/text_field.py", line 63, in token_indexers raise ValueError( ValueError: TextField's token_indexers have not been set. Did you forget to call DatasetReader.apply_token_indexers(instance) on your instance? If apply_token_indexers() is being called but you're still seeing this error, it may not be implemented correctly.

sebastian-hofstaetter commented 3 years ago

Hi, Thanks for using matchmaker! While trying to replicate your issue, i found another bug and fixed that one, but i could not reproduce your error. Could you post the full log.txt & config.yaml that gets saved in the experiment folder? Best, Sebastian