This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function map() { | |
emit(1, { | |
sum: this.value, // the field you want stats for | |
min: this.value, | |
max: this.value, | |
count: 1, | |
diff: 0 | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# install CUDA Toolkit v8.0 | |
# instructions from https://developer.nvidia.com/cuda-downloads (linux -> x86_64 -> Ubuntu -> 16.04 -> deb (network)) | |
CUDA_REPO_PKG="cuda-repo-ubuntu1604_8.0.61-1_amd64.deb" | |
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/${CUDA_REPO_PKG} | |
sudo dpkg -i ${CUDA_REPO_PKG} | |
sudo apt-get update | |
sudo apt-get -y install cuda |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#remove if already installed | |
sudo apt-get purge cuda | |
sudo apt-get purge libcudnn6 | |
sudo apt-get purge libcudnn6-dev | |
#install cuda and cudnn | |
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_9.0.176-1_amd64.deb | |
wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64/libcudnn7_7.0.5.15-1+cuda9.0_amd64.deb | |
wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64/libcudnn7-dev_7.0.5.15-1+cuda9.0_amd64.deb | |
wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64/libnccl2_2.1.4-1+cuda9.0_amd64.deb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Form a subset of the Flickr Style data, download images to dirname, and write | |
Caffe ImagesDataLayer training file. | |
""" | |
import os | |
import urllib.request | |
import hashlib | |
import argparse | |
import numpy as np |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# script used to publish package to npm and push new tag | |
# step 1 - change version from package json | |
# step 2 - run ./scripts/publish-npm.sh $version i.e ./scripts/publish-npm.sh 0.0.3 | |
set -e | |
if [ $# -eq 0 ] | |
then | |
echo "Please specify version." | |
exit | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
####### First Solution ######## | |
# create train and test list | |
find `pwd`/train -name \*.jpg > train.list | |
find `pwd`/test -name \*.jpg > test.list | |
######## Second Solution | |
# append path to already available files | |
REPLACE_TRAIN="\/path\/to\/train\/" | |
REPLACE_TEST="\/path\/to\/test\/" | |
sed -e "s/^/${REPLACE_TRAIN}/" > train.list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# edit .bashrc | |
nano /home/username/.bashrc | |
# append following lines into end of file | |
PATH=/usr/local/cuda-8.0/bin${PATH:+:${PATH}}$ | |
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} | |
#load source again |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# start ubuntu in init 3 mode | |
init3 | |
# stop lightdm | |
'sudo service lightdm stop' or 'sudo lightdm stop' | |
# set permission to executable | |
chmod +x ./your-nvidia-file.run | |
# install driver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export PATH=/usr/local/cuda/bin${PATH:+:${PATH}} | |
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# calculate ancors based on height and width | |
./darknet detector calc_anchors data/voc.data -num_of_clusters 9 -width 416 -height 416 | |
# check current IOU by relcall | |
./darknet detector recall cfg/suit.data cfg/suit-tiny.cfg backup/suit-tiny_100.weights |
OlderNewer