Skip to content

Instantly share code, notes, and snippets.

View zijunwei's full-sized avatar

zijunwei zijunwei

  • Adobe
  • San Jose
View GitHub Profile
@zijunwei
zijunwei / optimistic_restore.py
Last active March 4, 2017 00:17
Restore ckpt
# restore:
# https://github.com/tensorflow/tensorflow/issues/312
# def optimistic_restore(session, save_file):
# reader = tf.train.NewCheckpointReader(save_file)
# saved_shapes = reader.get_variable_to_shape_map()
# var_names = sorted([(var.name, var.name.split(':')[0]) for var in tf.global_variables()
# if var.name.split(':')[0] in saved_shapes])
# restore_vars = []
# with tf.variable_scope('', reuse=True):
# for var_name, saved_var_name in var_names:
@zijunwei
zijunwei / 0_reuse_code.js
Created November 18, 2015 14:38
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console