Skip to content
Advertisement

Output tensors of a Functional model must be the output of a TensorFlow `Layer`

So I’m trying to expand the Roberta Pretrained Model and I was doing a basic model for testing but I’m getting this error from TensorFlow: ValueError: Output tensors of a Functional model must be the output of a TensorFlow Layer. which is from the Model api of Keras but I don’t exactly know what’s causing it.

Code:

JavaScript

Full error traceback:

JavaScript

Data example:

enter image description here

Any help appreciated. I’m new to transformers so please feel free to point any extra considerations.

Advertisement

Answer

You need to pass a list of [input_ids , input_mask] to base_model.

JavaScript

Output:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement