Skip to content

Instantly share code, notes, and snippets.

View 1duo's full-sized avatar
:octocat:

Yuduo Wu 1duo

:octocat:
  • San Fransisco Bay Area
View GitHub Profile
@1duo
1duo / docker.in.docker.md
Last active October 4, 2018 23:48
Some notes for docker in docker.

Docker in docker implementation:

https://github.com/jpetazzo/dind

Issue:

docker pull consume tremendous amount of storage until no space left on device.

Check backing file system host docker is using with command docker info:

@1duo
1duo / postgres.md
Created October 4, 2018 21:37
Adding a new table to Postgres database.
  • Start a new Postgres docker container (with or without mount Postgres data):
$ docker run --name pg1 -p 5432:5432 -e POSTGRES_PASSWORD=postgres -d postgres
$ docker run --name pg1 -p 5432:5432 -e POSTGRES_PASSWORD=postgres -d -v postgres-data:/var/lib/postgresql/data postgres
  • Step into the Postgres database docker container:
@1duo
1duo / centos.install.horovod.md
Created July 25, 2018 21:13
Install Uber's Horovod distributed training framework for TensorFlow, Keras, and PyTorch on CentOS 7.

CentOS7, Python 2.7, CUDA 9.1, OpenMPI 3.10.0.

  • Install dependencies:
yum groupinstall -y "Development Tools"
yum install -y epel-release
yum install -y python-pip python-devel wget
import numpy as np
import tensorflow as tf


# np.set_printoptions(threshold=np.nan)


def run(x, w, pad='SAME', stride=(1, 1)):
 xx = tf.constant(x, dtype='float32')
@1duo
1duo / opencv.center.crop.cpp.md
Created July 16, 2018 22:27
Center crop using OpenCV.

C++ main.cpp:

#include <opencv2/core/core.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
#include <string>

using namespace cv;
@1duo
1duo / centos.install.nvidia.driver.md
Created June 25, 2018 19:04
Install NVIDIA driver on Linux CentOS 7.

Uninstall if you have old version installed:

nvidia-uninstall

Install dependencies:

yum -y update
@1duo
1duo / ubuntu.install.libjpeg-turbo.from.source.md
Created June 25, 2018 18:24
Install libjpeg-turbo from source on Linux Ubuntu.
sudo apt install -y nasm
wget https://downloads.sourceforge.net/libjpeg-turbo/libjpeg-turbo-1.5.2.tar.gz
tar xvf libjpeg-turbo-1.5.2.tar.gz && cd libjpeg-turbo-1.5.2
@1duo
1duo / ubuntu.install.protobuf.md
Created June 25, 2018 18:09
Install Protocol Buffers on Linux Ubuntu.

Protocol Buffers 2.6.1

sudo apt-get install build-essential
wget https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz
tar -zxvf protobuf-2.6.1.tar.gz && cd protobuf-2.6.1/
@1duo
1duo / tensorrt.v100.md
Last active June 8, 2018 01:01
TensorRT Performance on NVIDIA Volta V100 GPU.

TensorRT Performance on NVIDIA Volta V100 GPU

Ubuntu16.04, CUDA9.0, CUDNN7, Python2.7, TensorRT4.0.0.3, ResNet50 trained using Caffe.

Floating Point 32

BatchSize DataType Elapsed Images/sec
1 FP32 2.67725 373.517602016995
2 FP32 4.08289 489.849101984134
@1duo
1duo / centos.install.cmake.from.source.md
Last active October 24, 2024 05:58
Install CMake on CentOS 7.

Download CMake from: https://cmake.org/download/

wget https://cmake.org/files/v3.12/cmake-3.12.3.tar.gz

Compile from source and install

tar zxvf cmake-3.*