X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=dyncnn.git;a=blobdiff_plain;f=run.sh;h=fe3a2e2342a65cdd57f7a728d5de266ab1d71b9a;hp=890c2e07009cef06c0742c5c2a3536e5a32e2627;hb=5cbea5ca8a26719be70c974fab505e5b8695d9e4;hpb=51142591389a8119a337813899ae26d682e9f13d diff --git a/run.sh b/run.sh index 890c2e0..fe3a2e2 100755 --- a/run.sh +++ b/run.sh @@ -27,73 +27,57 @@ 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 +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 "${DYNCNN_RUNDIR}"/scheme_02000.t7 ]]; then + ./dyncnn.lua -rundir "${DYNCNN_RUNDIR}" fi -###################################################################### -# Create the images of internal activations +# Create the images of internal activations using the current.t7 in +# the rundir -for n in 2 12; do - ./dyncnn.lua --heavy --dataDir ./data/10p-mg/ \ - --learningStateFile "${DYNCNN_RESULT_DIR}"/epoch_01000_model \ - --resultDir "${DYNCNN_RESULT_DIR}" \ - --noLog \ - --exampleInternals ${n} -done +./dyncnn.lua -rundir "${DYNCNN_RUNDIR}" -noLog -exampleInternals 3,7 ###################################################################### # Plot the loss curves if gnuplot is here if [[ $(which gnuplot) ]]; then - echo "Plotting losses.pdf." + cat <