Skip to content

Commit

Permalink
trackml training
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomasz Chodakowski committed Aug 8, 2018
1 parent 1cd23ae commit 891f3e0
Show file tree
Hide file tree
Showing 5 changed files with 128 additions and 4 deletions.
69 changes: 69 additions & 0 deletions pointcnn_seg/trackml_dev_x8_fps.py
@@ -0,0 +1,69 @@
#!/usr/bin/python3

num_class = 50

sample_num = 3242

batch_size = 2

num_epochs = 1024

label_weights = []

label_weights = [1.0] * num_class

learning_rate_base = 0.005
decay_steps = 20000
decay_rate = 0.9
learning_rate_min = 0.00001
step_val = 500

weight_decay = 0.0

jitter = 0.001
jitter_val = 0.0

rotation_range = [0, 0, 0, 'u']
rotation_range_val = [0, 0, 0, 'u']
rotation_order = 'rxyz'

scaling_range = [0.0, 0.0, 0.0, 'g']
scaling_range_val = [0, 0, 0, 'u']

sample_num_variance = 1 // 8
sample_num_clip = 1 // 4

x = 8

xconv_param_name = ('K', 'D', 'P', 'C', 'links')
xconv_params = [dict(zip(xconv_param_name, xconv_param)) for xconv_param in
[(8, 1, -1, 32 * x, []),
(12, 2, 768, 32 * x, []),
(16, 2, 384, 64 * x, []),
(16, 6, 128, 128 * x, [])]]

with_global = True

xdconv_param_name = ('K', 'D', 'pts_layer_idx', 'qrs_layer_idx')
xdconv_params = [dict(zip(xdconv_param_name, xdconv_param)) for xdconv_param in
[(16, 6, 3, 3),
(16, 6, 3, 2),
(12, 6, 2, 1),
(8, 6, 1, 0),
(8, 4, 0, 0)]]

fc_param_name = ('C', 'dropout_rate')
fc_params = [dict(zip(fc_param_name, fc_param)) for fc_param in
[(32 * x, 0.0),
(32 * x, 0.5)]]

sampling = 'fps'

optimizer = 'adam'
epsilon = 1e-3

data_dim = 3
with_X_transformation = True
sorting_method = None

keep_remainder = True
4 changes: 2 additions & 2 deletions pointcnn_seg/train_val_shapenet.sh
Expand Up @@ -2,7 +2,7 @@

gpu=
setting=
models_folder="../../models/seg/"
models_folder="../../models/trackml/"
train_files="../../data/shapenet_partseg/train_files.txt"
val_files="../../data/shapenet_partseg/val_files.txt"

Expand Down Expand Up @@ -46,4 +46,4 @@ fi


echo "Train/Val with setting $setting on GPU $gpu!"
CUDA_VISIBLE_DEVICES=$gpu python3 ../train_val_seg.py -t $train_files -v $val_files -s $models_folder -m pointcnn_seg -x $setting > $models_folder/pointcnn_seg_$setting.txt 2>&1 &
CUDA_VISIBLE_DEVICES=$gpu python3 ../train_val_seg.py -t $train_files -v $val_files -s $models_folder -m pointcnn_seg -x $setting > $models_folder/trackml_seg_$setting.txt 2>&1 &
50 changes: 50 additions & 0 deletions pointcnn_seg/train_val_trackml_dev.sh
@@ -0,0 +1,50 @@
#!/usr/bin/env bash

gpu=
setting=
models_folder="../../models/seg/"
train_files="/home/tch/roaming/project/trackml/repo/kaggle_trackml/data/train_files.txt"
val_files="/home/tch/roaming/project/trackml/repo/kaggle_trackml/data/val_files.txt"


usage() { echo "train/val pointcnn_seg with -g gpu_id -x setting options"; }

gpu_flag=0
setting_flag=0
while getopts g:x:h opt; do
case $opt in
g)
gpu_flag=1;
gpu=$(($OPTARG))
;;
x)
setting_flag=1;
setting=${OPTARG}
;;
h)
usage; exit;;
esac
done

shift $((OPTIND-1))

if [ $gpu_flag -eq 0 ]
then
echo "-g option is not presented!"
usage; exit;
fi

if [ $setting_flag -eq 0 ]
then
echo "-x option is not presented!"
usage; exit;
fi

if [ ! -d "$models_folder" ]
then
mkdir -p "$models_folder"
fi


echo "Train/Val with setting $setting on GPU $gpu!"
CUDA_VISIBLE_DEVICES=$gpu python3 ../train_val_seg.py -t $train_files -v $val_files -s $models_folder -m pointcnn_seg -x $setting > $models_folder/pointcnn_seg_$setting.txt 2>&1 &
7 changes: 6 additions & 1 deletion sampling/tf_sampling_compile_tch.sh 100644 → 100755
@@ -1,5 +1,10 @@
#/bin/bash
PYTHON=python
PYTHON=python3

#patch cuda
#https://ask.fedoraproject.org/en/question/114489/cuda-9-nvcc-issue/
#or glibc
#https://devtalk.nvidia.com/default/topic/1023776/-request-add-nvcc-compatibility-with-glibc-2-26/

CUDA_PATH=/usr/local/cuda
TF_LIB=$($PYTHON -c 'import tensorflow as tf; print(tf.sysconfig.get_lib())')
Expand Down
2 changes: 1 addition & 1 deletion train_val_seg.py
Expand Up @@ -81,7 +81,7 @@ def main():
batch_num = (num_train * num_epochs + batch_size - 1) // batch_size
print('{}-{:d} training batches.'.format(datetime.now(), batch_num))
batch_num_val = math.ceil(num_val / batch_size)
print('{}-{:d} testing batches per test.'.format(datetime.now(), batch_num_val))
print('{}-{:d} validation batches per test.'.format(datetime.now(), batch_num_val))

######################################################################
# Placeholders
Expand Down

0 comments on commit 891f3e0

Please sign in to comment.