Cannot get test logits after training for TFSequenceClassifier on TF 2
- `transformers` version: 4.4.2
- Platform: Linux-5.4.17-2036.102.0.2.el7uek.x86_64-x86_64-with-glibc2.10
- Python version: 3.8.8
- PyTorch version (GPU?): 1.8.0 (True)
- Tensorflow version (GPU?): 2.4.1 (True)
- Using GPU in script?: (True)
- Using distributed or parallel set-up in script?: (True)

After fitting the model, I am trying to get the logits of the test dataset to calculate the confusion matrix as follows:
`y_pred = tf.nn.softmax(bert_model.predict(test_dataset))`
`y_pred_argmax = tf.math.argmax(y_pred, axis=1)`

I am getting this error:
`ValueError: Attempt to convert a value (TFSequenceClassifierOutput(loss=None, logits=None, hidden_states=None, attentions=None)) with an unsupported type (<class 'transformers.modeling_tf_outputs.TFSequenceClassifierOutput'>) to a Tensor.`

When I try to print the predict() output I get:
`TFSequenceClassifierOutput(loss=None, logits=None, hidden_states=None, attentions=None)`

Note that using the `evaluate()` method works fine
`loss, accuracy = bert_model.evaluate(test_dataset)`
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.