Skip to content

TypeError: unhashable type: 'dict' while using batch_generator #2

@austinyoung1

Description

@austinyoung1

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions