X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=dyncnn.git;a=blobdiff_plain;f=run.sh;h=fe3a2e2342a65cdd57f7a728d5de266ab1d71b9a;hp=d905ef996a22d739fbaf91bcab00dabdc15876f9;hb=5cbea5ca8a26719be70c974fab505e5b8695d9e4;hpb=8e60c68637e79580cdefa53edf79a4804849997d diff --git a/run.sh b/run.sh index d905ef9..fe3a2e2 100755 --- a/run.sh +++ b/run.sh @@ -27,42 +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" - -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 +[[ "${DYNCNN_RUNDIR}" ]] || DYNCNN_RUNDIR="./results" + +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 (takes days) +# 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 + +./dyncnn.lua -rundir "${DYNCNN_RUNDIR}" -noLog -exampleInternals 3,7 + +###################################################################### +# Plot the loss curves if gnuplot is here + +if [[ $(which gnuplot) ]]; then + cat <