Created
September 1, 2020 18:11
-
-
Save michhar/9a48726eba94f164358a75f1a9fde610 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
# This script is intended as an initialization script used in azuredeploy.json | |
# See documentation here: https://docs.microsoft.com/en-us/azure/virtual-machines/extensions/custom-script-linux#template-deployment | |
# see abbreviated notes in README.md | |
# comments below: | |
adminUser=$1 | |
WD=/home/$adminUser/ | |
echo WD is $WD | |
if [ ! -d $WD ]; then | |
echo $WD does not exist - aborting!! | |
exit | |
else | |
cd $WD | |
echo "Working in $(pwd)" | |
fi | |
# Fix a broken repository | |
sudo cp /etc/apt/sources.list.d/tensorflow-serving.list /etc/apt/sources.list.d/tensorflow-serving.list.save | |
sudo rm /etc/apt/sources.list.d/tensorflow-serving.list | |
# Update repos | |
sudo apt update | |
# Install OpenCV | |
sudo apt-get install python-opencv | |
# Clone darknet | |
git clone https://github.com/AlexeyAB/darknet.git | |
cd darknet/ | |
# Update the Makefile | |
sed -i "s/GPU=0/GPU=1/g" Makefile | |
sed -i "s/CUDNN=0/CUDNN=1/g" Makefile | |
sed -i "s/CUDNN_HALF=0/CUDNN_HALF=1/g" Makefile | |
sed -i "s/OPENCV=0/OPENCV=1/g" Makefile | |
sed -i "s/AVX=0/AVX=1/g" Makefile | |
sed -i "s/OPENMP=0/OPENMP=1/g" Makefile | |
sed -i "s/LIBSO=0/LIBSO=1/g" Makefile | |
# Build darknet | |
make | |
echo "Done!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment