JAVA Predict
### Who can help
<!-- Your issue will be replied to more quickly if you can figure out the right person to tag with @
 If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
 Please tag fewer than 3 people.

Models:

- how save pertained BERT model in .pb, and load model by java and predict???
- this is model saved:
-   model = TFBertForSequenceClassification.from_pretrained(model_path, num_labels=num_classes)
    model.summary()
    optimizer = tf.keras.optimizers.Adam(learning_rate=learning_rate, epsilon=1e-08, clipnorm=1)
    loss = tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True)
    model.compile(optimizer=optimizer, loss=loss, metrics=[tf.keras.metrics.SparseCategoricalAccuracy(name='accruacy')])
    # fit model
    bert_history = model.fit(ds_train_encoded, epochs=number_of_epochs, validation_data=ds_val_encoded,use_multiprocessing=True)

    tf.saved_model.save(model, saved_model)

ValueError: Exception encountered when calling layer "tf_bert_for_sequence_classification" (type TFBertForSequenceClassification).

- `transformers` version:4.12.5
- Platform:java
- Python version:3.7
- PyTorch version (GPU?):
- Tensorflow version (GPU?):2.4.1
- Using GPU in script?:
- Using distributed or parallel set-up in script?:

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.