text-generator
text-generator copied to clipboard
Loaded Model doesn't work, can't use model for run-time predict
Tried to load the model and continue training, it seems like it starts with high loss and the model seems to be totally untrained (start over at epoch 0). The previous trained work seems to be all gone. No error message from loading. Any clue? I upgraded to Keras 2.0.8 from .6, verified the setup of the network (using the same setup code) but no help.
I think I found the problem. For some reason, the ix_to_char index is different every time when the code is run, messing up all the char sequence during prediction. Note that it doesn't happen if I run the code in python IDE. Strange! I ended up sorted the ix_and_char. Or, I can save the ix_to_char during training and load it up during runtime or con't training.
Is there any chance you could show the changes you made to the code? I'm struggling to get the RNN to load any/all stored weights.
Are you specifying the weight argument correctly while running the code. I ran it as follows and it continued training from the previously left epoch. python recurrent_keras.py -weight=checkpoint_layer_2_hidden_500_epoch_80.hdf5 In this case, it continued training from the 80th epoch.
@jcbnose Just had the same problem, I'm sad I realize this after 440 epochs :/
@hobbycodernovice : In order to sort the chars vocab, I transformed this line :
chars = list(set(data))
into this one :
chars = sorted(list(set(data)))
in RNN_utils.py l. 28