Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
# Install and compile Caffe on NVIDIA Jetson TK1 Development Kit
sudo add-apt-repository universe
sudo apt-get update
sudo apt-get install libprotobuf-dev protobuf-compiler gfortran \
libboost-dev cmake libleveldb-dev libsnappy-dev \
libboost-thread-dev libboost-system-dev \
libatlas-base-dev libhdf5-serial-dev libgflags-dev \
libgoogle-glog-dev liblmdb-dev -y
#!/bin/bash
sudo sh -c "echo 'deb http://security.ubuntu.com/ubuntu utopic-security main' >> /etc/apt/sources.list"
sudo apt-get -y update
sudo apt-get -y install build-essential libncurses-dev fakeroot kernel-package
sudo apt-get -y install linux-source
sudo apt-get -y install linux-image-3.16.0-43-generic linux-headers-3.16.0-43 linux-source-3.16.0
cd /usr/src
#/bin/sh
cd ~
git clone https://github.com/viennacl/viennacl-dev.git
cd viennacl-dev
mkdir build && cd build
cmake ..
make
ubunut_version=`lsb_release --release | cut -f2`
echo $ubunut_version
@tzutalin
tzutalin / clDeviceQuery.cpp
Last active April 16, 2023 19:02
Query OpenCL devices
/* Copyright 1993-2009 NVIDIA Corporation. All rights reserved.
Modified by Mark Zwolinski, December 2009
Modified by Robert McGibbon, August 2013
*/
#ifdef __APPLE__
#include <OpenCL/opencl.h>
#else
#include <CL/cl.h>
#endif
#include <stdlib.h>
@tzutalin
tzutalin / installCaffeDep.sh
Last active November 26, 2015 08:12
installCaffeDep.sh
#!/bin/sh
sudo apt-get install -y git
sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler
sudo apt-get install --no-install-recommends libboost-all-dev
sudo apt-get install libatlas-base-dev
sudo apt-get install libopenblas-dev
sudo apt-get install liblapack-dev
@tzutalin
tzutalin / classify_test.py
Last active August 31, 2015 06:50
classify_test.py
import numpy as np
import matplotlib.pyplot as plt
import sys
import caffe
import os
import time
def convertbinarytonpy(binaryprotosrc, npytarget):
if os.path.exists(binaryprotosrc):
blob = caffe.proto.caffe_pb2.blobproto()
@tzutalin
tzutalin / test_xtion.sh
Last active August 29, 2015 14:27
ASUS Xtion on ROS
# If using usb 3.0 or above, should turn it down in BIOS(Advance->USB->xhci) disable xhci
#Install dependencies:
sudo apt-get install ros-indigo-rgbd-launch ros-indigo-openni2-camera ros-indigo-openni2-launch
# Install package rqt and useful plugins:
sudo apt-get install ros-indigo-rqt ros-indigo-rqt-common-plugins ros-indigo-rqt-robot-plugins
# Open Terminal 1
roscore
@tzutalin
tzutalin / monitor_mem.sh
Created August 24, 2015 10:44
Monitor Process's memory on Ubuntu Usage: sh monitor_mem.sh PID
#!/bin/sh
while true; do
sudo python ps_mem.py -p $1
sleep 3
done
@tzutalin
tzutalin / Log.h
Last active October 9, 2020 00:26
Simple Log.h in C++
#include <iostream>
#include <string>
#include <ctime>
#include <cstdlib>
namespace da{
struct nullstream: std::ostream{
nullstream(): std::ostream(0){}
};
@tzutalin
tzutalin / deploy.prototxt
Last active May 11, 2018 10:01
Network In Network
name: "nin_imagenet"
input: "data"
input_shape {
dim: 10
dim: 3
dim: 224
dim: 224
}
layers {
bottom: "data"