Closed MatsumotoHiroko closed 7 years ago
yes, you can load ckpt model and then save it to npz.
Thank you for your response. I have revised my code, then tensorlayer has made npz file successfully!
with tf.Session() as sess:
sess.run(tf.global_variables_initializer())
ckpt = tf.train.get_checkpoint_state(FLAGS.train_dir)
if ckpt:
target_list = []
for v in tf.global_variables():
if v.shape != ():
target_list.append(v.name)
last_model = ckpt.model_checkpoint_path
tl.files.load_ckpt(sess=sess, mode_name=last_model, printable=True)
tl.files.save_npz(target_list, name='{}/cifar10.npz'.format(FLAGS.output_dir), sess=sess)
I'm looking for the way about to convert ckpt to npz. I have founded this page http://tensorlayer.readthedocs.io/en/latest/modules/files.html. I think if we use tensorlayer, we can convert its format.
I try running blow code.
After trainning, npz file was created. But this file's rows are few lines. It was failer to make.
Can tensorlayer convert ckpt to npz by unless making "network"?