X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=dyncnn.git;a=blobdiff_plain;f=run.sh;h=3f8529d5714de4daa3e9884285adc0c3c3b6a154;hp=c6f269037f24dd9516fc877fb60c28e0859510b4;hb=HEAD;hpb=1ac95d100c59265ae76df4fea676f016e1b19a50 diff --git a/run.sh b/run.sh index c6f2690..3f8529d 100755 --- a/run.sh +++ b/run.sh @@ -27,73 +27,67 @@ set -o pipefail [[ "${TORCH_NB_THREADS}" ]] || echo "You can set \$TORCH_NB_THREADS to the proper value (default 1)." [[ "${TORCH_USE_GPU}" ]] || echo "You can set \$TORCH_USE_GPU to 'yes' or 'no' (default 'no')." + [[ "${DYNCNN_DATA_DIR}" ]] || DYNCNN_DATA_DIR="./data/10p-mg" -[[ "${DYNCNN_RESULT_DIR}" ]] || DYNCNN_RESULT_DIR="./results" +[[ "${DYNCNN_RUNDIR}" ]] || DYNCNN_RUNDIR="./results" -###################################################################### -# Create the data-set if needed - -if [[ -d "${DYNCNN_DATA_DIR}" ]]; then - echo "Found ${DYNCNN_DATA_DIR}, checking the number of images in there." - if [[ $(find "${DYNCNN_DATA_DIR}" -name "dyn_*.png" | wc -l) == 150000 ]]; then - echo "Looks good !" - else - echo "I do not find the proper number of images. Please remove the dir and re-run this scripts, or fix manually." - exit 1 - fi -else +NB_EPOCHS=2000 + +if [[ ! -d "${DYNCNN_DATA_DIR}" ]]; then # Creating the data-base make -j -k mkdir -p "${DYNCNN_DATA_DIR}" - ./flatland 50000 \ - --every_nth 4 --nb_frames 5 \ - --multi_grasp --nb_shapes 10 \ + # 17 frames every 16 is two frames: t+0 and t+16 + ./flatland 40000 \ + --nb_shapes 10 \ + --random_grasp --every_nth 16 --nb_frames 17 \ --dir "${DYNCNN_DATA_DIR}" fi -###################################################################### -# Train the model (~30h on a GTX1080) +# Train the model (2000 epochs takes 30h on a GTX 1080 with cuda 8.0, +# cudnn 5.1, and recent torch) -if [[ ! -f "${DYNCNN_RESULT_DIR}"/epoch_01000_model ]]; then - ./dyncnn.lua --heavy --dataDir="${DYNCNN_DATA_DIR}" \ - --resultFreq=100 \ - --resultDir "${DYNCNN_RESULT_DIR}" \ - --nbEpochs 1000 +if [[ -f "$(printf "%s/model_%04d.t7" "${DYNCNN_RUNDIR}" ${NB_EPOCHS})" ]]; then + echo "Found the model already trained through ${NB_EPOCHS} epochs." +else + ./dyncnn.lua -nbEpochs ${NB_EPOCHS} -rundir "${DYNCNN_RUNDIR}" fi -###################################################################### -# Create the images of internal activations +# Create the images of internal activations using the current.t7 in +# the rundir + + cat <