1 import tensorflow as tf
2 from tensorflow import keras
4 tf.compat.v1.disable_eager_execution()
6 model = keras.Sequential()
8 model.add(keras.layers.SimpleRNN(2, input_shape=shape))
10 # Note that this code will generate pb model only with TF 1.x.x
12 # to save model in TF 2.x.x use
13 # - to dump keras model: model.save("rnn.h5")
14 # - to dump saved model: tf.saved_model.save(model, "rnn")