Skip to content

Instantly share code, notes, and snippets.

@subhankar94
subhankar94 / restore_checkpoint.py
Created Jun 23, 2017
restoring from checkpoint for TensorFlow v1.x
View restore_checkpoint.py
# usage: python restore_checkpoint.py model.ckpt-1000
import sys
import tensorflow as tf
ckpt = sys.argv[1]
# soft placement in case using a different system setup
config = tf.ConfigProto(allow_soft_placement=True)
with tf.Session(config=config) as sess:
new_saver = tf.train.import_meta_graph(ckpt + '.meta')
new_saver.restore(sess, ckpt)
@subhankar94
subhankar94 / mcilroy.sh
Created Nov 24, 2016
McIlroy's 6 line shell script to print k most frequently occurring words in a file
View mcilroy.sh
tr -cs A-Za-z '\n' | # transliterate non-alphabetic chars (-c) to newline ('\n'), squeeze identical adjacent to single instance (-s)
tr A-Z a-z | # transliterate upper case characters to lower case
sort | # sort alphabetically
uniq -c | # collapse identical adjacent lines and add occurence of each line (-c)
sort -rn | # sort in reverse (-r), based on numeric value (-n)
sed ${1}q # pass through stream editor, print first-arg-many words and then quit (q)
View keybase.md

Keybase proof

I hereby claim:

  • I am subhankar94 on github.
  • I am subhankar (https://keybase.io/subhankar) on keybase.
  • I have a public key ASDOfIwXn2HsjckIiGAkK4hClcUXC6uosVn9C9gK0uLiZwo

To claim this, I am signing this object: