Closed thistlillo closed 2 years ago
Hi,
You are not using the API correctly in this example. The LSTM accepts a vector of parent layers in the first argument, this vector can be of length one if you are providing the input data only, or it can be of length two if you provide the input data and a States layer. In this example, you are trying to pass three inputs ([word_emb, context, states_input]), which is not supported.
Thank you! Problem solved...
word_emb = eddl.ReduceArgMax(word_in, [0])
word_emb = eddl.RandomUniform(eddl.Embedding(word_emb, vs, 1, emb_size, mask_zeros=True, name="word_embeddings"), -0.05, +0.05)
to_lstm = eddl.Concat([word_emb, context]) # <------------ new line
lstm = eddl.LSTM([to_lstm, states_input], lstm_size, mask_zeros=True, bidirectional=False, name="lstm")
lstm.isrecurrent = False
Perfect!
There is another issue open on the PyEDDL section (https://github.com/deephealthproject/pyeddl/issues/73), but Simone Leo did notice it is the same with the C++ implementation, so I file it also here.
This is the original post:
Trying not to use a recurrent LSTM network for avoiding the issue in deserialization (issue #72) I am trying to train the model without a recurrent LSTM layer, using the "finest" training method. I get a segmentation fault in the
forward()
method: I am not sure whether it is a bug or a mistake in my code, that you may find right after the dev settings.The segmentation fault occurs both on GPU and CPU.
Could you please take a look at the code?
Dev settings:
The output is: