I am trying to build a simple model in Tensorflow 2.1.0 with Keras layers.
However, running this code:
from tensorflow import keras
from tensorflow.keras import layers
def main():
max_input_length = 20
vocab_size = 10
model = keras.Sequential()
model.add(layers.Embedding(vocab_size, 16, input_length=max_input_length))
# ..
if __name__ == '__main__':
main()
Throws a TypeError exception:
TypeError: Saw an object that is an instance of a strict subclass of EagerTensor, which is not supported. Item 0 is type: tensorflow.python.framework.ops.EagerTensor
What am I doing wrong here?