How to merge TFDistilBertForSequenceClassification with another tf.Keras model
## ❓ Questions & Help

In TensorFlow 2, what is the recommended way to merge `TFDistilBertForSequenceClassification` (or any other Transformer model) with another `tf.keras` model?

In other words, I'd like to do something like this:

```
merged_out = keras.layers.concatenate([other_model.output, distilbert_model.output])
merged_out = layers.Dense(1)(merged_out)
combined_model = keras.Model([other_model.input] + distilbert_model.input, merged_out)
```
The above produces an error because `distilbert_model.output` is not accessible in the same way as vanilla tf.Keras models:
```
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-48-b15ccf9c0221> in <module>()
----> 1 merged_out = keras.layers.concatenate([other_model.output, distilbert_model.output])

/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/keras/engine/base_layer.py in output(self)
   1574     """
   1575     if not self._inbound_nodes:
-> 1576       raise AttributeError('Layer ' + self.name + ' has no inbound nodes.')
   1577     return self._get_node_attribute_at_index(0, 'output_tensors', 'output')
   1578 

AttributeError: Layer tf_distil_bert_for_sequence_classification has no inbound nodes.
```


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.
<|||||>Wait, is this just the end? Am also interested in doing this<|||||>This [comment](https://github.com/huggingface/transformers/issues/4733#issuecomment-647414520) may help you?