jiangsutx / SRN-Deblur

Repository for Scale-recurrent Network for Deep Image Deblurring
http://www.xtao.website/projects/srndeblur/srndeblur_cvpr18.pdf
MIT License
710 stars 184 forks source link

re train using previous checkpoint #15

Closed rahul12122 closed 5 years ago

rahul12122 commented 5 years ago

how to train network using previous checkpoint

dcrmg commented 5 years ago

try to change the following code in "model.py": `self.saver = tf.train.Saver(max_to_keep=50, keep_checkpoint_every_n_hours=1) coord = tf.train.Coordinator() threads = tf.train.start_queue_runners(sess=sess, coord=coord)

summary_op = tf.summary.merge_all() summary_writer = tf.summary.FileWriter(self.train_dir, sess.graph, flush_secs=30)`

to: `# training summary summary_op = tf.summary.merge_all() summary_writer = tf.summary.FileWriter(self.train_dir, sess.graph, flush_secs=30)

saver = tf.train.import_meta_graph(r'./checkpoints/color/deblur.model-523000.meta') saver.restore(sess, tf.train.latest_checkpoint(r'./checkpoints/color/')) self.saver = saver

coord = tf.train.Coordinator() threads = tf.train.start_queue_runners(sess=sess, coord=coord)`

Williamlizl commented 3 years ago

try to change the following code in "model.py": `self.saver = tf.train.Saver(max_to_keep=50, keep_checkpoint_every_n_hours=1) coord = tf.train.Coordinator() threads = tf.train.start_queue_runners(sess=sess, coord=coord)

summary_op = tf.summary.merge_all() summary_writer = tf.summary.FileWriter(self.train_dir, sess.graph, flush_secs=30)`

to: `# training summary summary_op = tf.summary.merge_all() summary_writer = tf.summary.FileWriter(self.train_dir, sess.graph, flush_secs=30)

saver = tf.train.import_meta_graph(r'./checkpoints/color/deblur.model-523000.meta') saver.restore(sess, tf.train.latest_checkpoint(r'./checkpoints/color/')) self.saver = saver

coord = tf.train.Coordinator() threads = tf.train.start_queue_runners(sess=sess, coord=coord)`

I also need to change the datalist .txt, add my own data to it?

noranali commented 1 year ago

try to change the following code in "model.py": `self.saver = tf.train.Saver(max_to_keep=50, keep_checkpoint_every_n_hours=1) coord = tf.train.Coordinator() threads = tf.train.start_queue_runners(sess=sess, coord=coord)

summary_op = tf.summary.merge_all() summary_writer = tf.summary.FileWriter(self.train_dir, sess.graph, flush_secs=30)`

to: `# training summary summary_op = tf.summary.merge_all() summary_writer = tf.summary.FileWriter(self.train_dir, sess.graph, flush_secs=30)

saver = tf.train.import_meta_graph(r'./checkpoints/color/deblur.model-523000.meta') saver.restore(sess, tf.train.latest_checkpoint(r'./checkpoints/color/')) self.saver = saver

coord = tf.train.Coordinator() threads = tf.train.start_queue_runners(sess=sess, coord=coord)`

hi,thanks.your reply helps me but is this only will be changed. i understand that you restore the model graph with value but how can i feed the training data to work with this restored graph and then save the new weights ? . please help