(ses)
| 96 | alexnet_saver = tf.train.Saver(pretrained_var_map) |
| 97 | |
| 98 | def init_fn(ses): |
| 99 | log.info('Initializing parameters.') |
| 100 | if not has_stuff(c.BVLC_CKPT_PATH): |
| 101 | print('\n--------- ImageNet checkpoint not found, downloading ----------') |
| 102 | download(c.BVLC_CKPT_URL, c.WEIGHTS_DIR, warn_existing=False, overwrite=True) |
| 103 | ses.run(init_op) |
| 104 | alexnet_saver.restore(ses, c.BVLC_CKPT_PATH) |
| 105 | |
| 106 | saver = tf.train.Saver() |
| 107 | sv = tf.train.Supervisor(is_chief=True, |