is this a bug in TFTrainer.get_train_tfdataset?
my environment below:
transformers==4.0.0
tensorflow-gpu==2.3.0
python==3.7
when I use TFTrainer(model, train_dataset, val_dataset), wether my dataset is tf.data.Dataset.from_generator or tf.data.TFRecordDataset, their dataset.cardinality() always -2, so in TFTrainer.get_train_tfdataset() func, 
self.num_train_examples = self.train_dataset.cardinality().numpy()
if self.num_train_examples < 0:
      raise ValueError("The training dataset must have an asserted cardinality")
I coludn't use TFTrainer, I think tf.data.Dataset.from_generator or tf.data.TFRecordDataset, should be supported.
Hi @TheHonestBob! The `TFTrainer` class was deprecated a while ago, so it is likely that it fails under a few circumstances (and we don't have plans to maintain it).

Have you tried using the native Keras API? Here are our docs for fine-tuning with Keras: https://huggingface.co/docs/transformers/master/en/training#finetune-with-keras

Let me know if the Keras API solves your issues :)<|||||>thanks for your reply, I also use tf.keras, so I solve it with your docs.<|||||>I'm closing this issue, but feel free to reopen it if the problem persists.