Closed timurmamedov closed 7 years ago
While running predict.py I am getting a similar issue wehn the model tries to load the trained weights. Here is my snippet of the code (Though its not an error but I guess it can be checked once)
Loading /home/ubuntu/train.hdf5 to sequential_1
embedding_1
lstm_1
dropout_1
lstm_2
dropout_2
lstm_3
dropout_3
simplecontext_1
timedistributed_1
failed to find layer timedistributed_1 in model
weights 944x40000 40000
stopping to load all other layers
@vibrantabhi19 I think it was an issue with version of Keras we are running. Try renaming all instances of string timedistributed_1
to time_distributed_1
. Both in train
and predict
.
This fixed it for me, hope it helps!
Hence, I am closing the issue.
Hi I am currently trying to execute the following line of code...
weights = [np.copy(v) for v in f['timedistributed_1'].itervalues()]
insidepredict.ipynb
, but keep getting the following error. I am not sure what might be causing it.Perhaps an issue could be with the following code inside
train.ipynb
...model.add(TimeDistributed(Dense(vocab_size, kernel_regularizer=regularizer, bias_regularizer=regularizer, name = 'timedistributed_1')))
but it seems ok to me
PS I am using TensorFlow if this helps
Error:
KeyError Traceback (most recent call last)