fast-style-transfer
fast-style-transfer copied to clipboard
Convert checkpoint state to model
Hello! After training I have 4 files (checkpoint, fns.ckpt, fns.ckpt.index, fns.ckpt.meta) in checkpoint directory, 200 Mb in total. And to evaluate picture with learned style i need all these 4 files, but your pretrained models are single files of 20 Mb each one. How can I convert my 4 files to such a model file? Thank you for your attention!
@KostyaAtarik After training my model, I also have the following files; checkpoint
, fns.ckpt.data-00000-of-00001
, fns.ckpt.index
, and fns.ckpt.meta
. You can evaluate using the /path/to/trained/model/checkpoint
. Don't need to specify the exact files. It worked for me to only supply the checkpoint folder.
python evaluate.py --checkpoint path/to/style/checkpoint --in-path dir/of/test/imgs/ --out-path dir/for/results/
@jshaw Thank you for your answer! It works for me too to evaluate using the checkpoint folder, but what I was actually asking is how to convert the mess in the checkpoint folder to one tiny handy to transfer and use model file.
Tensorflow's Saver class seems to have been updated since the release of this project.
Change saver = tf.train.Saver() to saver = tf.train.Saver(write_version=tf.train.SaverDef.V1)
it's in src/optimize.py
#78
saver = tf.train.Saver(write_version=tf.train.SaverDef.V1)
For Tensorflow 2 users:
saver = tf.compat.v1.train.Saver(write_version=tf.compat.v1.train.SaverDef.V1)