Open sankin1770 opened 6 years ago
May I ask how to do the third step? I am looking forward to your reply.
you can add the assign operation after init like this:
sess.run(init)
init_update_op = [tf.assign(b, a) for a, b in zip(net_var_list["{0}".format(0)], net_var_list["{0}".format(1)])] sess.run(init_update_op)
tf.train.start_queue_runners(sess=sess)
Here the name_scope of net_var_list["{0}".format(0)] should be 'MobilenetV1'.
Thank you for your reply. I'm a novice at tensorflow. I use Saver = tf. train. Saver () - - saver. restore (sess, "resnetv1_50. ckpt") to restore the parameters of the model pre-training on Imagenet, But it doesn't seem to work Please tell me what variables should I fill in in the brackets of tf. train. Saver (*) ....
To load pretrained models, you can learn from "Fine-tuning a model from an existing checkpoint " on https://github.com/tensorflow/models/tree/master/research/slim. Or you can check https://github.com/YingZhangDUT/Cross-Modal-Projection-Learning where I load pretrained resnet152.
你可以设置两个Saver, 主函数的saver = tf.train.Saver(tf.global_variables())用来保存两个net的参数,restore的时候再设置一个 restorer = tf.train.Saver(variables_to_restore) 用来restore pretrain的参数。其中 variables_to_restore 则是所有MobileNetV1的参数。
Originally posted by @YingZhangDUT in https://github.com/YingZhangDUT/Deep-Mutual-Learning/issues/4#issuecomment-388688149