jananiarunachalam / Research-Paper-Summarization

Text Summarization for Research Papers
72 stars 19 forks source link

About Model Training #5

Open hlhuyhlhuy opened 2 years ago

hlhuyhlhuy commented 2 years ago

Can someone give me the model.h5 file, please? I am having trouble with the following error:


 Exception encountered when calling layer "tf.keras.backend.rnn" (type TFOpLambda).

You are passing KerasTensor(type_spec=TensorSpec(shape=(None, 1000), dtype=tf.float32, name=None), name='tf.nn.softmax_1/Softmax:0', description="created by layer 'tf .nn.softmax_1'"), an intermediate Keras symbolic input/output, to a TF API that does not allow registering custom dispatchers, such as `tf.cond`, `tf.function`, gradient tapes, or `tf.map_fn `. Keras Functional model construction only supports TF API calls that *do* support dispatching, such as `tf.math.add` or `tf.reshape`. Other APIs cannot be called directly on symbolic Kerasinputs/outputs. You can work around this limitation by putting the operation in a custom Keras layer `call` and calling that layer on this symbolic input/output.

It help me for final project, I'm 20 years old. Thank you

01miaom commented 2 years ago

This might be due to a tensorflow update,

base on: https://github.com/thushv89/attention_keras You can try to replace class AttentionLayer(Layer): with class AttentionLayer(tf.keras.layers.Layer): in the part of attention layer