Input structure has type class tuple while shallow structure has type class transformers.modeling_tf_outputs.TFQuestionAnsweringModelOutput
Author: seahrh
Pull request: no

## Environment info
- transformers version: 4.5.1
- Platform: Linux-4.4.0-19041-Microsoft-x86_64-with-Ubuntu-18.04-bionic
- Python version: 3.7.5
- PyTorch version (GPU?): 1.8.1+cu102 (False)
- Tensorflow version (GPU?): 2.4.1 (False)
- Using GPU in script?: No
- Using distributed or parallel set-up in script?: No

### Who can help
- tensorflow: @Rocketknight1
- maintained examples (not research project or legacy): @sgugger, @patil-suraj

## Information

Model I am using (Bert, XLNet ...):

The problem arises when using:
* [x] the official example scripts: (give details below)
* [ ] my own modified scripts: (give details below)

Official tensorflow example: https://huggingface.co/transformers/custom_datasets.html#question-answering-with-squad-2-0

The tasks I am working on is:
* [x] an official GLUE/SQUaD task: Squad2
* [ ] my own task or dataset: (give details below)

## To reproduce

Steps to reproduce the behavior:

Executed the official example in [my notebook](https://github.com/seahrh/kaggle-coleridge-initiative/blob/8087c6189d8e96679ec9a60816910ad86ed20480/hf_tf_squad2_finetune_example.ipynb) but encountered the following error on `model.fit`:
```
TypeError: The two structures don't have the same sequence type. Input structure has type <class 'tuple'>, while shallow structure has type <class 'transformers.modeling_tf_outputs.TFQuestionAnsweringModelOutput'>.
```

In cell 11, I made sure to `model.distilbert.return_dict = False` (if using 🤗 Transformers >3.02, make sure outputs are tuples) and had mapped the `start_positions` and `end_positions` as tuples in cell 9 (Keras will expect a tuple when dealing with labels).

I noted the following warning emitted by `model.fit`. If `return_dict` is always set to True at training time, then wouldn't this conflict with the "labels as tuple" requirement?

```
WARNING:tensorflow:The parameter `return_dict` cannot be set in graph mode and will always be set to `True`.
```

## Expected behavior

Official example is working.


Comments:
Hi, our Tensorflow examples are in flux right now, because we're in the process of updating them and generally trying to replace TFTrainer with native Keras code. The examples on that page may be outdated, but you can see an up-to-date example of using TF for QA here: https://github.com/huggingface/transformers/blob/master/examples/tensorflow/question-answering/run_qa.py

That said, thank you for the report - I'll make a point of taking a look at that page at some point and ensuring our examples there are also up-to-date!

Thank you! Studying the code in the link helped me to set up a minimal working example. We should probably close this issue after the TF example docs have been updated. 

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/master/CONTRIBUTING.md) are likely to be ignored.