forked from BMW-InnovationLab/BMW-YOLOv4-Training-Automation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_docker_linux_gpu.sh
27 lines (26 loc) · 1.25 KB
/
run_docker_linux_gpu.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
echo -n "Enter your dataset's absolute path (folder containing images', labels' folders and configuration file): "
read folder_path
configfile=$folder_path/train_config.json
echo -n "Choose a name for the docker container: "
read container_name
ports=''
if [ -f $configfile ]; then
custom_api=`jq .training.custom_api.enable $configfile`
if [ "$custom_api" = "true" ]; then
custom_api_port=`jq .training.custom_api.port $configfile`
ports="$ports -p $custom_api_port:$custom_api_port"
fi
tensorboard=`jq .training.tensorboard.enable $configfile`
if [ "$tensorboard" = "true" ]; then
tensorboard_port=`jq .training.tensorboard.port $configfile`
ports="$ports -p $tensorboard_port:6006"
fi
web_ui=`jq .training.web_ui.enable $configfile`
if [ "$web_ui" = "true" ]; then
web_ui_port=`jq .training.web_ui.port $configfile`
ports="$ports -p $web_ui_port:8090"
fi
sudo docker run --rm --runtime=nvidia -it -e TRAIN_NAME=$container_name -e TRAIN_START_TIME="$(date '+%Y%m%d_%H:%M:%S')" $ports -v $folder_path:/training/assets -v $(pwd)/trainings:/training/custom_training -v /etc/timezone:/etc/timezone:ro -v /etc/localtime:/etc/localtime:ro --name $container_name darknet_yolo_gpu:1 ;
else
echo "Error: Configuration file not found in the provided path"
fi