NeuroNER
NeuroNER copied to clipboard
loading saved models
Hello Franck, First of all thanks for providing this great tool!
I found that saving the model to disk gave me 3 files instead of 1 model_000.ckpt.index
and model_000.ckpt.index
. I had to add a line on the train.py lines model_saver = tf.train.import_meta_graph(pretrained_model_checkpoint_filepath +'.meta')
just before model_saver.restore(sess,pretrained_model_checkpoint_filepath)
line 130 and 140.
This is a just a trick explained here
I saw as well that you changed the trained_model_checkpoint_filepath
parameter in an update, but left it unchanged in the pretrained model. But I think it's not a problem.
Thanks again for this Repo! It makes it really easy to train and tune a good model!
I'm having the same problem but your solution didn't work in my case. Somehow the model I trained is recorded in pieces -one piece for each epoch, I suppose- and they are not gathered in one file, which I don't know why -being not very familiar with tensorflow.
Somehow the model I trained is recorded in pieces -one piece for each epoch, I suppose- and they are not gathered in one file, which I don't know why -being not very familiar with tensorflow.
That's intended. The model is saved for each epoch, i.e. there is one saved model for each epoch. You have to choose which epoch/model you prefer to use. E.g., you could choose the epoch/model with the best performances on valid set.
yes, sure! it is my ignorance.. : ) i thought in the end one model file is generated out of what is best learned throughout the epoches. using the best model, now everything works without a problem. thanks!
No worries, it's better to use the GitHub Q&A/issues than being stuck :-)