KeyError: in convert_tokens_to_ids()
In BertTokenizer's, [convert_tokens_to_ids](https://github.com/huggingface/pytorch-pretrained-BERT/blob/19666dcb3bee3e379f1458e295869957aac8590c/pytorch_pretrained_bert/tokenization.py#L117) function gives KeyError. So, I suggest to modify the **for loop** in the function as follows.

```
for token in tokens:
    ids.append(self.vocab.get(token, self.vocab['[UNK]']))
```


Hi @wasiahmad,
This should actually already been taken care of by the WordPieceTokenizer ([here](https://github.com/huggingface/pytorch-pretrained-BERT/blob/19666dcb3bee3e379f1458e295869957aac8590c/pytorch_pretrained_bert/tokenization.py#L357)).
Do you have a simple example to share so I can try to reproduce the behavior?<|||||>Hi @thomwolf ,
 I alse found the same question when using BertTokenizer class. 
Code likes:
```
sent = ['hi', 'mary']
tokenizer = BertTokenizer.from_pretrained('bert-base-cased')
model_bert = BertModel.from_pretrained('bert-base-cased')
tokenizer.convert_tokens_to_ids(sent)
```<|||||>Hi @thomwolf 
I didn't record that token for which I encountered that error but that token was not an English word, it was more like a weird symbol which was probably able to bypass WordPieceTokenizer. I was using BERT as a feature extractor for MSMARCO v2 QA dataset when I encountered the error.<|||||>@congjianluo you should not tokenize the sentence your self but use Bert tokenizer.
Please follow the usage example in the [readme](https://github.com/huggingface/pytorch-pretrained-BERT#bert).
In your case:
```python
sent = "hi mary"
tokenizer = BertTokenizer.from_pretrained('bert-base-cased')
tokens = tokenizer.tokenize(sent)
tokens_ids = tokenizer.convert_tokens_to_ids(tokens)
```<|||||>@wasiahmad ok then I'm closing this issue.
Feel free to re-open it if you have a (reproductible) example of such issue.