CyberZHG / keras-self-attention

Attention mechanism for processing sequential data that considers the context for each timestamp.

Home Page:https://pypi.org/project/keras-self-attention/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error when loading model (.h5 file) in Java (deeplearning 4j)

cuongnguyengit opened this issue · comments

Hi, I hava a model in Keras Python Code in here

import keras
from keras_self_attention import SeqSelfAttention

model = keras.models.Sequential()
model.add(keras.layers.Embedding(input_dim=10000,
output_dim=300,
mask_zero=True))
model.add(keras.layers.Bidirectional(keras.layers.LSTM(units=128,
return_sequences=True)))
model.add(SeqSelfAttention(attention_activation='sigmoid'))
model.add(keras.layers.Dense(units=5))
model.compile(
optimizer='adam',
loss='categorical_crossentropy',
metrics=['categorical_accuracy'],
)
model.summary()
model.fit(..)
mode.save(model.h5)

I tried to load the model in Java by Deeplearning4j. I have an error that is Deeplearning4j had not to recognize SeqSelfAttention Layer. May be SeqSelfAttention Layer dont register for some object.
Can you help me to fix that?

VERY VERY THANKS SO MUCH.
PLEASE GIVE ME SOMETHING.....

commented

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

It's a hard problem

commented

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.