Error using TFAutoModelForSequenceClassification with Tensorflow 2.2.0
Author: ghost
Pull request: no

Hello. 

I am trying to implement `TFAutoModelForSequenceClassification` in my code following the example for sequence classification as shown [here](https://huggingface.co/transformers/task_summary.html#sequence-classification)

The code is as follows:

```
from transformers import AutoTokenizer, TFAutoModelForSequenceClassification
import tensorflow as tf
tokenizer = AutoTokenizer.from_pretrained("bert-base-cased-finetuned-mrpc")
model = TFAutoModelForSequenceClassification.from_pretrained("bert-base-cased-finetuned-mrpc")
classes = ["not paraphrase", "is paraphrase"]
sequence_0 = "The company HuggingFace is based in New York City"
sequence_1 = "Apples are especially bad for your health"
sequence_2 = "HuggingFace's headquarters are situated in Manhattan"
paraphrase = tokenizer(sequence_0, sequence_2, return_tensors="tf")
not_paraphrase = tokenizer(sequence_0, sequence_1, return_tensors="tf")
paraphrase_classification_logits = model(paraphrase)[0]
not_paraphrase_classification_logits = model(not_paraphrase)[0]
paraphrase_results = tf.nn.softmax(paraphrase_classification_logits, axis=1).numpy()[0]
not_paraphrase_results = tf.nn.softmax(not_paraphrase_classification_logits, axis=1).numpy()[0]
# Should be paraphrase
for i in range(len(classes)):
    print(f"{classes[i]}: {int(round(paraphrase_results[i] * 100))}%")
# Should not be paraphrase
for i in range(len(classes)):
    print(f"{classes[i]}: {int(round(not_paraphrase_results[i] * 100))}%")

```

Here is the error readout: 
```

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-20-c48d70c01597> in <module>
      2 import tensorflow as tf
      3 tokenizer = AutoTokenizer.from_pretrained("bert-base-cased-finetuned-mrpc")
----> 4 model = TFAutoModelForSequenceClassification.from_pretrained("bert-base-cased-finetuned-mrpc")
      5 classes = ["not paraphrase", "is paraphrase"]
      6 sequence_0 = "The company HuggingFace is based in New York City"

~/.conda/envs/myenv/lib/python3.8/site-packages/transformers-4.2.2-py3.8.egg/transformers/models/auto/modeling_tf_auto.py in from_pretrained(cls, pretrained_model_name_or_path, *model_args, **kwargs)
   1189 
   1190         if type(config) in TF_MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING.keys():
-> 1191             return TF_MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING[type(config)].from_pretrained(
   1192                 pretrained_model_name_or_path, *model_args, config=config, **kwargs
   1193             )

~/.conda/envs/myenv/lib/python3.8/site-packages/transformers-4.2.2-py3.8.egg/transformers/modeling_tf_utils.py in from_pretrained(cls, pretrained_model_name_or_path, *model_args, **kwargs)
   1216 
   1217         # Instantiate model.
-> 1218         model = cls(config, *model_args, **model_kwargs)
   1219 
   1220         if from_pt:

~/.conda/envs/myenv/lib/python3.8/site-packages/transformers-4.2.2-py3.8.egg/transformers/models/bert/modeling_tf_bert.py in __init__(self, config, *inputs, **kwargs)
   1369 
   1370         self.num_labels = config.num_labels
-> 1371         self.bert = TFBertMainLayer(config, name="bert")
   1372         self.dropout = tf.keras.layers.Dropout(config.hidden_dropout_prob)
   1373         self.classifier = tf.keras.layers.Dense(

~/.conda/envs/myenv/lib/python3.8/site-packages/transformers-4.2.2-py3.8.egg/transformers/modeling_tf_utils.py in wrapped_init(self, *args, **kwargs)
    105         elif isinstance(config, PretrainedConfig):
    106             if len(args) > 0:
--> 107                 initializer(self, *args, **kwargs)
    108             else:
    109                 initializer(self, config, *args, **kwargs)

~/.conda/envs/myenv/lib/python3.8/site-packages/transformers-4.2.2-py3.8.egg/transformers/models/bert/modeling_tf_bert.py in __init__(self, config, add_pooling_layer, **kwargs)
    590         self.return_dict = config.use_return_dict
    591         self.embeddings = TFBertEmbeddings(config, name="embeddings")
--> 592         self.encoder = TFBertEncoder(config, name="encoder")
    593         self.pooler = TFBertPooler(config, name="pooler") if add_pooling_layer else None
    594 

~/.conda/envs/myenv/lib/python3.8/site-packages/transformers-4.2.2-py3.8.egg/transformers/models/bert/modeling_tf_bert.py in __init__(self, config, **kwargs)
    430         super().__init__(**kwargs)
    431 
--> 432         self.layer = [TFBertLayer(config, name="layer_._{}".format(i)) for i in range(config.num_hidden_layers)]
    433 
    434     def call(

~/.conda/envs/myenv/lib/python3.8/site-packages/transformers-4.2.2-py3.8.egg/transformers/models/bert/modeling_tf_bert.py in <listcomp>(.0)
    430         super().__init__(**kwargs)
    431 
--> 432         self.layer = [TFBertLayer(config, name="layer_._{}".format(i)) for i in range(config.num_hidden_layers)]
    433 
    434     def call(

~/.conda/envs/myenv/lib/python3.8/site-packages/transformers-4.2.2-py3.8.egg/transformers/models/bert/modeling_tf_bert.py in __init__(self, config, **kwargs)
    410         super().__init__(**kwargs)
    411 
--> 412         self.attention = TFBertAttention(config, name="attention")
    413         self.intermediate = TFBertIntermediate(config, name="intermediate")
    414         self.bert_output = TFBertOutput(config, name="output")

~/.conda/envs/myenv/lib/python3.8/site-packages/transformers-4.2.2-py3.8.egg/transformers/models/bert/modeling_tf_bert.py in __init__(self, config, **kwargs)
    344         super().__init__(**kwargs)
    345 
--> 346         self.self_attention = TFBertSelfAttention(config, name="self")
    347         self.dense_output = TFBertSelfOutput(config, name="output")
    348 

~/.conda/envs/myenv/lib/python3.8/site-packages/transformers-4.2.2-py3.8.egg/transformers/models/bert/modeling_tf_bert.py in __init__(self, config, **kwargs)
    254         self.num_attention_heads = config.num_attention_heads
    255         self.attention_head_size = int(config.hidden_size / config.num_attention_heads)
--> 256         self.query = tf.keras.layers.experimental.EinsumDense(
    257             equation="abc,cde->abde",
    258             output_shape=(None, config.num_attention_heads, self.attention_head_size),

AttributeError: module 'tensorflow.keras.layers.experimental' has no attribute 'EinsumDense'

```

I cannot seem to find a lot of information on solving this on Google. Any ideas? I am using a dockerized version of tensorflow 2.2.0 with Jupyter. This is a fresh install of transformers. 


Comments:
@jplu could answer here

Hello!

The last version os Transformers needs TensorFlow 2.3 as the min version.

Got it. I switched to Pytorch for testing it, so I have not faced the same issue. Out of curiousity, if I wanted to run huggingface transformers on TF 2.2.0, what version of transformers do I need to use? Thanks!

Not more than 4.1

Thanks.