Skip to content

Instantly share code, notes, and snippets.


Jongwook Choi wookayin

View GitHub Profile
wookayin / keras-save-bug.ipynb
Created Mar 8, 2019
TensorFlow Keras model save bug
View keras-save-bug.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
wookayin /
Created Jan 25, 2019
Matplotlib animations
from matplotlib import animation
from IPython.display import display_html
from IPython.display import HTML
def display_frames_as_gif(frames):
Displays a list of frames as a gif, with controls
fig, ax = plt.subplots()
patch = ax.imshow(frames[0])
wookayin /
Created Oct 14, 2018
Test script for reproducing a tmux passthrough bug
function print_osc() {
if [[ -n $TMUX ]] ; then
printf "\033Ptmux;\033\033]";
else printf "\033]"; fi
function print_st() {
if [[ -n $TMUX ]] ; then

Displaying Configurations in TensorBoard

This is a simple demonstration of displaying training configuration in a TensorBoard, using text summaries.


import tensorflow as tf
import tensorflow.contrib.layers as layers
from datetime import datetime
# MNIST input data
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("/tmp/data/", one_hot=True)
def multilayer_perceptron(x):
fc1 = layers.fully_connected(x, 256, activation_fn=tf.nn.relu, scope='fc1')
wookayin /
Last active Mar 19, 2019
IPython notebook snippet for plotting multiple images in a grid.
# in a courtesy of Caffe's filter visualization example
def imshow_grid(data, height=None, width=None, normalize=False, padsize=1, padval=0):
Take an array of shape (N, H, W) or (N, H, W, C)
and visualize each (H, W) image in a grid style (height x width).
if normalize:
data -= data.min()
brew install poppler
# 현재 디렉토리의 모든 *.pdf 패턴을 page1 만 추출해서 page1.*.pdf 로 저장
for source_pdf in ./*.pdf; do
pdfseparate -f 1 -l 1 ${source_pdf} page1.${source_pdf}
pdfunite page1.* page1.merged.pdf
wookayin /
Last active Mar 12, 2018
Reset tensorflow, in ipython notebook
# use the following snippet in your ipython notebook shell
import argparse
import tensorflow as tf = tf.python.platform.flags._FlagValues() = argparse.ArgumentParser()
def im_drawbox(window, color='r', class_name='', score=0.0):
Add a detection window (bounding box) into the current plot image.
window: tuple-like of length 4 (xmin, ymin, xmax, ymax)
import matplotlib.pyplot as plt
xmin, ymin, xmax, ymax = window
coords = (ymin, xmin), ymax - ymin, xmax - xmin
currentAxis = plt.gca()
View 01.configure
2014-09-28 11:59:00 +0900
You can’t perform that action at this time.