ALBERT with Masked Language Model Input Processing from SavedModel
Author: zzj0402
Pull request: no
Labels: name: wontfix

# 🐛 Bug

## Information

Model I am using (Bert, XLNet ...): ALBERT

Language I am using the model on (English, Chinese ...): English

The problem arises when using:
* [ ] the official example scripts: (give details below)
* [x] my own modified scripts: (give details below)
```
input_ids=tf.convert_to_tensor(input_ids,name='input_ids',dtype=tf.int32)
attention_mask=tf.convert_to_tensor(attention_mask,name='attention_mask',dtype=tf.int32)
position_ids=tf.convert_to_tensor(position,name='position_ids',dtype=tf.int32)
token_type_ids=tf.convert_to_tensor(type_emb,name='token_type_ids',dtype=tf.int32)
inputs={'input_ids': input_ids, 'position_ids': position_ids, 'token_type_ids': token_type_ids, 'attention_mask': attention_mask}
print(inputs)
outputs=model(inputs,training=False)
```
The tasks I am working on is:
* [x] an official GLUE/SQUaD task: (give the name)
* [ ] my own task or dataset: (give details below)

## To reproduce

Steps to reproduce the behavior:

1. Set the inputs
2. Run the above script

<!-- If you have code snippets, error messages, stack traces please provide them here as well.
     Important! Use code tags to correctly format your code. See https://help.github.com/en/github/writing-on-github/creating-and-highlighting-code-blocks#syntax-highlighting
     Do not use screenshots, as they are hard to read and (more importantly) don't allow others to copy-and-paste your code.-->

```
ValueError: Could not find matching function to call loaded from the SavedModel. Got:
  Positional arguments (1 total):
    * {'input_ids': <tf.Tensor 'inputs_1:0' shape=(512,) dtype=int32>, 'position_ids': <tf.Tensor 'inputs_2:0' shape=(512,) dtype=int32>, 'token_type_ids': <tf.Tensor 'inputs_3:0' shape=(512,) dtype=int32>, 'attention_mask': <tf.Tensor 'inputs:0' shape=(512,) dtype=int32>}
  Keyword arguments: {'training': False}

Expected these arguments to match one of the following 4 option(s):

Option 1:
  Positional arguments (1 total):
    * {'position_ids': TensorSpec(shape=(None, 512), dtype=tf.int32, name='position_ids'), 'token_type_ids': TensorSpec(shape=(None, 512), dtype=tf.int32, name='token_type_ids'), 'attention_mask': TensorSpec(shape=(None, 512), dtype=tf.int32, name='attention_mask'), 'input_ids': TensorSpec(shape=(None, 512), dtype=tf.int32, name='input_ids')}
  Keyword arguments: {'training': True}

Option 2:
  Positional arguments (1 total):
    * {'position_ids': TensorSpec(shape=(None, 512), dtype=tf.int32, name='inputs/position_ids'), 'token_type_ids': TensorSpec(shape=(None, 512), dtype=tf.int32, name='inputs/token_type_ids'), 'attention_mask': TensorSpec(shape=(None, 512), dtype=tf.int32, name='inputs/attention_mask'), 'input_ids': TensorSpec(shape=(None, 512), dtype=tf.int32, name='inputs/input_ids')}
  Keyword arguments: {'training': True}

Option 3:
  Positional arguments (1 total):
    * {'input_ids': TensorSpec(shape=(None, 512), dtype=tf.int32, name='input_ids'), 'position_ids': TensorSpec(shape=(None, 512), dtype=tf.int32, name='position_ids'), 'token_type_ids': TensorSpec(shape=(None, 512), dtype=tf.int32, name='token_type_ids'), 'attention_mask': TensorSpec(shape=(None, 512), dtype=tf.int32, name='attention_mask')}
  Keyword arguments: {'training': False}

Option 4:
  Positional arguments (1 total):
    * {'position_ids': TensorSpec(shape=(None, 512), dtype=tf.int32, name='inputs/position_ids'), 'token_type_ids': TensorSpec(shape=(None, 512), dtype=tf.int32, name='inputs/token_type_ids'), 'attention_mask': TensorSpec(shape=(None, 512), dtype=tf.int32, name='inputs/attention_mask'), 'input_ids': TensorSpec(shape=(None, 512), dtype=tf.int32, name='inputs/input_ids')}
  Keyword arguments: {'training': False}
```

## Expected behavior

<!-- A clear and concise description of what you would expect to happen. -->
The model makes prediction on the inputs

## Environment info
<!-- You can run the command `transformers-cli env` and copy-and-paste its output below.
     Don't forget to fill out the missing fields in that output! -->
     
- `transformers` version: 2.8.0
- Platform: Ubuntu 16
- Python version: 3.7.7
- Tensorflow version (GPU?): 2.1.0 GPU
- Using GPU in script?: Yes
- Using distributed or parallel set-up in script?: No


Comments:
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.


Hi! I have the similar problem too. Have you fixed it? If so, how?