InvalidArgumentError: Cannot convert a Tensor of dtype resource to a NumPy array.
# 🐛 Bug

## Information

Model I am using (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

```python
def build_model(item_dim, num_layers, num_heads, max_len):
    config = BertConfig(hidden_size=item_dim, num_hidden_layers=num_layers,
                        num_attention_heads=num_heads, intermediate_size=item_dim*4,
                        max_position_embeddings=max_len)
    bert = TFBertMainLayer(config=config)
    inputs = Input(shape=(max_len, item_dim), dtype=tf.float32, name='inputs')
    # pre-training vectors to bert
    seq_emb = bert(inputs=None, inputs_embeds=inputs)[0]
    print(seq_emb)
    print(seq_emb[:, -1, :])
    last_token_emb = seq_emb[:, -1, :]
    outputs = Dense(1, activation='sigmoid')(last_token_emb)
    model = Model(inputs=inputs, outputs=outputs)
    return model
```

Errors with
`InvalidArgumentError: Cannot convert a Tensor of dtype resource to a NumPy array.`

<!-- 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
* Run the code successfully when feed pre-training vectors to bert.
<!-- A clear and concise description of what you would expect to happen. -->

## 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! -->
https://colab.research.google.com/gist/Douboo/adf6e136e45f8406b1070d88f4041a49/untitled2.ipynb
     
- `transformers` version: 3.0.2
- Platform: google colab
- Python version: 3.7
- PyTorch version (GPU?):
- Tensorflow version (GPU?): 2.2.0
- Using GPU in script?: yes
- Using distributed or parallel set-up in script?: no

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
