Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
set -e
set -x
GPU=0
CWD=$(pwd)
CAFFE_DIR=/raid/jdonahue/philkr-caffe
MAGIC_DIR=~/magic_init
CLASS_DIR=/raid/jdonahue/voc-classification
import numpy as np
def canonical_axis(x, axis):
def is_int_ndarray(x):
if not isinstance(x, np.ndarray):
return False
dtype = str(x.dtype)
prefixes = 'int', 'uint'
return any(dtype.startswith(p) for p in prefixes)
if axis is None:
#!/usr/bin/env python
# usage: python count_caffemodel_params.py /path/to/my.caffemodel [/path/to/my/other.caffemodel, ...]
from caffe.proto import caffe_pb2
import sys
assert len(sys.argv) >= 2
for caffemodel_filename in sys.argv[1:]:
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
# create our directories
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# Either wget or curl is required.
# It's assumed that a C/C++ compiler are installed.
# exit on error
set -e
@jeffdonahue
jeffdonahue / alexnet_dummydata_nolrn.prototxt
Created November 11, 2015 01:24
AlexNet with no LRNs and dummy data, for comparison with TensorFlow
layer {
name: "data"
type: "DummyData"
top: "data"
top: "label"
dummy_data_param {
shape { dim: [128, 3, 227, 227] }
shape { dim: [128] }
}
}
sshput () {
RSAKEY="${HOME}/.ssh/id_rsa.pub"
DSAKEY="${HOME}/.ssh/id_dsa.pub"
if [ $# -eq 2 ]; then
KEY=$1
if [ ! -r $KEY ]
then
echo "'$KEY' does not exist or is not readable"
return 1
#!/bin/bash
INDIR=$1
OUTDIR=$2
echo "Cloning leveldb in ${INDIR} to ${OUTDIR}"
INPATH=`realpath ${INDIR}`
mkdir -p ${OUTDIR}