How to save the whole model as SavedModel format for inference?
# ❓ Questions & Help

<!-- The GitHub issue tracker is primarly intended for bugs, feature requests,
     new models and benchmarks, and migration questions. For all other questions,
     we direct you to the Hugging Face forum: https://discuss.huggingface.co/ .
     You can also try Stack Overflow (SO) where a whole community of PyTorch and
     Tensorflow enthusiast can help you out. In this case, make sure to tag your
     question with the right deep learning framework as well as the
     huggingface-transformers tag: 
     https://stackoverflow.com/questions/tagged/huggingface-transformers 
     -->

## Details
Hi, I want to save the mode as SavedModel format using model.save(), but when i load it, the input_format is fixed and only input_ids can be used, how can i pass the inputs like {'input_dis':XX, 'attention_mask':XX}?
codes:
![image](https://user-images.githubusercontent.com/38073340/91794928-df871e80-ec4e-11ea-86a8-9c264913b5b7.png)
and then it reports:
![image](https://user-images.githubusercontent.com/38073340/91794969-f168c180-ec4e-11ea-98e1-2e1db94632ea.png)

The model  architecture is simple:
![image](https://user-images.githubusercontent.com/38073340/91795291-db0f3580-ec4f-11ea-814f-2342ecfd1b1a.png)
<|||||>Sorry for the late reply. This is because you did not respect the signature of `TFBertMainLayer` in order to properly use it you can do:

```python
import tensorflow as tf
from transformers import TFBertForSequenceClassification

a = tf.constant([[1,2,3,4,5]])
b = tf.constant([[1,1,1,1,1]])
inp = {"input_ids": a, "attention_mask": b}
model = TFBertForSequenceClassification.from_pretrained("bert-base-cased")
model._saved_model_inputs_spec = None
model._set_save_spec(inp)
tf.saved_model.save(model, "/tmp")
model = tf.keras.models.load_model("/tmp")
```<|||||>This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
