`TypeError: unhashable type: 'list'` when using DataCollatorForWholeWordMask
Author: sikfeng
Pull request: no

## Environment info
<!-- You can run the command `transformers-cli env` and copy-and-paste its output below.
     Don't forget to fill out the missing fields in that output! -->
     
- `transformers` version: 3.5.0
- Platform: Linux-5.9.1-arch1-1-x86_64-with-arch
- Python version: 3.7.3
- PyTorch version (GPU?): 1.7.0 (False)
- Tensorflow version (GPU?): not installed (NA)
- Using GPU in script?: No
- Using distributed or parallel set-up in script?: No

### Who can help
<!-- Your issue will be replied to more quickly if you can figure out the right person to tag with @
 If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
 Please tag fewer than 3 people.-->
 @sgugger

## Information

Model I am using (Bert, XLNet ...): Bert

The problem arises when using:
* [ ] the official example scripts: (give details below)
* [x] my own modified scripts: (give details below)

The tasks I am working on is:
* [ ] an official GLUE/SQUaD task: (give the name)
* [x] my own task or dataset: (give details below)

## To reproduce

Steps to reproduce the behavior:

This is the code I am running

```python
from transformers import BertTokenizer, BertForMaskedLM, AdamW, BertConfig, get_linear_schedule_with_warmup, pipeline, DataCollatorForWholeWordMask, DataCollatorForLanguageModeling

tokenizer = BertTokenizer.from_pretrained('bert-base-multilingual-cased', do_lower_case=True)

sent = "The capital of France is Paris."

data_collator = DataCollatorForWholeWordMask(tokenizer=tokenizer, mlm=True, mlm_probability=0.15)

encoded = tokenizer(
  sent,
  truncation = True,
  add_special_tokens = True,
  max_length = 64,
  return_tensors = 'pt',
  return_special_tokens_mask = True,
)

masked = data_collator([encoded])

print(masked)
```

It gives me the following error

```python
Traceback (most recent call last):
  File "sadness.py", line 19, in <module>
    masked = data_collator([encoded])
  File "/home/csikfeng/.local/lib/python3.7/site-packages/transformers/data/data_collator.py", line 328, in __call__
    token = self.tokenizer._convert_id_to_token(id)
  File "/home/csikfeng/.local/lib/python3.7/site-packages/transformers/tokenization_bert.py", line 241, in _convert_id_to_token
    return self.ids_to_tokens.get(index, self.unk_token)
TypeError: unhashable type: 'list'
```

But if instead I use `data_collator = DataCollatorForLanguageModeling(tokenizer=tokenizer, mlm=True, mlm_probability=0.15)
` like this
```python
from transformers import BertTokenizer, BertForMaskedLM, AdamW, BertConfig, get_linear_schedule_with_warmup, pipeline, DataCollatorForWholeWordMask, DataCollatorForLanguageModeling

tokenizer = BertTokenizer.from_pretrained('bert-base-multilingual-cased', do_lower_case=True)

sent = "The capital of France is Paris."

data_collator = DataCollatorForLanguageModeling(tokenizer=tokenizer, mlm=True, mlm_probability=0.15)

encoded = tokenizer(
  sent,
  truncation = True,
  add_special_tokens = True,
  max_length = 64,
  return_tensors = 'pt',
  return_special_tokens_mask = True,
)

masked = data_collator([encoded])

print(masked)
```
I do not get any errors

```
{'input_ids': tensor([[[  101, 10105, 12185, 10108, 63184, 10112, 10124, 24289, 10107,   119,
            102]]]), 'token_type_ids': tensor([[[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]]), 'attention_mask': tensor([[1]]), 'labels': tensor([[[-100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100]]])}
```

<!-- If you have code snippets, error messages, stack traces please provide them here as well.
     Important! Use code tags to correctly format your code. See https://help.github.com/en/github/writing-on-github/creating-and-highlighting-code-blocks#syntax-highlighting
     Do not use screenshots, as they are hard to read and (more importantly) don't allow others to copy-and-paste your code.-->

## Expected behavior

<!-- A clear and concise description of what you would expect to happen. -->

It should just perform whole word masking and not have errors.

Comments:
Can reproduce, working on a fix right now.

So, `DataCollatorForWholeWordMask` has a few deisgn flaws (it only works for BERT for instance) and fixing it is not directly doable (basically what it tries to do should be done at the tokenization level). I will adapt the `run_mlm_wwm` example to stop using it and we will probably deprecate it afterward.

For your specific problem however, there is a fix, which is to remove the `return_tensors='pt'` from the tokenzier call.

This solves my problem, thanks!