OffensEval2020-code
OffensEval2020-code copied to clipboard
TypeError: unhashable type: 'dict' while using batch_generator
I have an error in the following line: for batch_index, batch_dict in enumerate(batch_generator):
Error:
TypeError Traceback (most recent call last) in () 19 ) 20 model.train() ---> 21 for batch_index, batch_dict in enumerate(batch_generator): 22 optimizer.zero_grad() 23 12 frames /usr/local/lib/python3.7/dist-packages/transformers/tokenization_utils.py in _convert_token_to_id_with_added_voc(self, token) 398 return None 399 --> 400 if token in self.added_tokens_encoder: 401 return self.added_tokens_encoder[token] 402 return self._convert_token_to_id(token) TypeError: unhashable type: 'dict'
How can I solve this?
If you could please share a Colab Notebook reproducing this error it would be easier for me to investigate the issue.
Thanks for the reply. I'm using a small dataset of my own. Data: https://drive.google.com/drive/folders/1kgmWjgfYR0kg8M1EnTnyjQdd7rdwkzv1?usp=sharing Notebook: https://colab.research.google.com/drive/1yPlcI_rKNQ2uwuvPgFo047A6v52RuNCc?usp=sharing
@austinyoung1 Hi, austinyoung1. Have you solved it? I ran into the same problem as you.