You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For some reason, I have to use ELMo in Keras platform. When I try to write a Keras Layer for ELMo, I notice that when the input of BidirectionalLanguageModel is keras.layer.Input, the whole program will be stuck, but if the input is tf.placeholder, it will go through the code successfully but Keras model doesn't allow a non-Input input layer. How can I fix this? Please help me.
lstm_output_1 = Bidirectional(LSTM(units=_char_lstm_size, return_sequences=True))(elmo_embeddings)
`
By using "char_ids", it will be stuck; if I use "tmp", the model can't be formed for regarding non-Input layers as the input of model.
The text was updated successfully, but these errors were encountered:
For some reason, I have to use ELMo in Keras platform. When I try to write a Keras Layer for ELMo, I notice that when the input of BidirectionalLanguageModel is keras.layer.Input, the whole program will be stuck, but if the input is tf.placeholder, it will go through the code successfully but Keras model doesn't allow a non-Input input layer. How can I fix this? Please help me.
The layer is implemented like:
`
class ElmoEmbeddingLayer(Layer):
And when I use it I just:
`
elmo_model = ElmoEmbeddingLayer(self.data_config)
tmp = tf.placeholder(tf.int32, shape=(None, None))
char_ids = Input(batch_shape=(None, None), dtype='int32', name='input_ids')
elmo_embeddings = elmo_model(char_ids)
lstm_output_1 = Bidirectional(LSTM(units=_char_lstm_size, return_sequences=True))(elmo_embeddings)
`
By using "char_ids", it will be stuck; if I use "tmp", the model can't be formed for regarding non-Input layers as the input of model.
The text was updated successfully, but these errors were encountered: