Created
March 24, 2019 17:06
-
-
Save gkthiruvathukal/8fc9262ec1b594e9c4d280df60f5e327 to your computer and use it in GitHub Desktop.
singularity recipe and how to build/run for YOLOv3/darknet
This file contains hidden or 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
| To run this gist, you need to have the singularity container framework installed on your computer. | |
| The host system must have a GPGPU. |
This file contains hidden or 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
| sudo singularity build darknet-singularity.simg darknet-singularity.recipe |
This file contains hidden or 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
| Bootstrap: docker | |
| From: nvidia/cuda:9.0-cudnn7-devel-centos7 | |
| %help | |
| Centos7 with cuda9.0 cudnn7 | |
| To start your container simply try | |
| singularity exec THIS_CONTAINER.simg bash | |
| To use GPUs, try | |
| singularity exec --nv THIS_CONTAINER.simg bash | |
| %environment | |
| # for system | |
| export CUDA_DEVICE_ORDER=PCI_BUS_ID | |
| # Add cupti to the path for profiling: | |
| export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/extras/CUPTI/lib64 | |
| source scl_source enable devtoolset-4 | |
| %post | |
| # yum basics | |
| yum update -y | |
| yum groupinstall -y "Development Tools" | |
| yum install -y epel-release | |
| yum install -y centos-release-scl | |
| yum install -y devtoolset-4 | |
| yum install -y wget emacs vim | |
| yum install -y emacs vim openssh-clients zip | |
| yum install -y python-devel python-pip python-setuptools | |
| yum install -y hdf5 | |
| yum install -y opencv opencv-devel opencv-python | |
| # pip basics | |
| pip --no-cache-dir --disable-pip-version-check install --upgrade setuptools | |
| pip --no-cache-dir --disable-pip-version-check install future | |
| pip --no-cache-dir --disable-pip-version-check install 'matplotlib<3.0' # for python2.7 | |
| pip --no-cache-dir --disable-pip-version-check install 'ipython<6.0' # for python2.7 | |
| pip --no-cache-dir --disable-pip-version-check install 'ipykernel<5.0' # for python2.7 | |
| pip --no-cache-dir --disable-pip-version-check install numpy wheel zmq six pygments pyyaml cython gputil psutil humanize h5py tqdm scipy seaborn tables | |
| pip --no-cache-dir --disable-pip-version-check install pandas scikit-image scikit-learn Pillow opencv-python | |
| pip --no-cache-dir --disable-pip-version-check install jupyter notebook | |
| # verify OpenCV | |
| pkg-config --modversion opencv | |
| # YOLO | |
| git clone https://github.com/pjreddie/darknet | |
| cd darknet | |
| make |
This file contains hidden or 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
| singularity run darknet-singularity.simg darknet/darknet | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment