outdoor_ds.sh 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/bash -l
  2. SCRIPTPATH=$(dirname $(readlink -f "$0"))
  3. PROJECT_DIR="${SCRIPTPATH}/../../"
  4. # conda activate loftr
  5. export PYTHONPATH=$PROJECT_DIR:$PYTHONPATH
  6. cd $PROJECT_DIR
  7. TRAIN_IMG_SIZE=640
  8. # to reproduced the results in our paper, please use:
  9. # TRAIN_IMG_SIZE=840
  10. data_cfg_path="configs/data/megadepth_trainval_${TRAIN_IMG_SIZE}.py"
  11. main_cfg_path="configs/loftr/outdoor/loftr_ds_dense.py"
  12. n_nodes=1
  13. n_gpus_per_node=4
  14. torch_num_workers=4
  15. batch_size=1
  16. pin_memory=true
  17. exp_name="outdoor-ds-${TRAIN_IMG_SIZE}-bs=$(($n_gpus_per_node * $n_nodes * $batch_size))"
  18. python -u ./train.py \
  19. ${data_cfg_path} \
  20. ${main_cfg_path} \
  21. --exp_name=${exp_name} \
  22. --gpus=${n_gpus_per_node} --num_nodes=${n_nodes} --accelerator="ddp" \
  23. --batch_size=${batch_size} --num_workers=${torch_num_workers} --pin_memory=${pin_memory} \
  24. --check_val_every_n_epoch=1 \
  25. --log_every_n_steps=1 \
  26. --flush_logs_every_n_steps=1 \
  27. --limit_val_batches=1. \
  28. --num_sanity_val_steps=10 \
  29. --benchmark=True \
  30. --max_epochs=30