train_4GPU.sh 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #!/usr/bin/env bash
  2. # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. rm -rf /results
  16. BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
  17. export CUDA_VISIBLE_DEVICES=0,1,2,3
  18. mpirun \
  19. -np 4 \
  20. -H localhost:4 \
  21. -bind-to none \
  22. -map-by slot \
  23. -x NCCL_DEBUG=VERSION \
  24. -x LD_LIBRARY_PATH \
  25. -x PATH \
  26. -mca pml ob1 -mca btl ^openib \
  27. --allow-run-as-root \
  28. python ${BASEDIR}/../mask_rcnn_main.py \
  29. --mode="train_and_eval" \
  30. --checkpoint="/model/resnet/resnet-nhwc-2018-02-07/model.ckpt-112603" \
  31. --eval_samples=5000 \
  32. --init_learning_rate=0.02 \
  33. --learning_rate_steps="60000,80000" \
  34. --model_dir="/results/" \
  35. --num_steps_per_eval=7392 \
  36. --total_steps=90000 \
  37. --train_batch_size=4 \
  38. --eval_batch_size=8 \
  39. --training_file_pattern="/data/train*.tfrecord" \
  40. --validation_file_pattern="/data/val*.tfrecord" \
  41. --val_json_file="/data/annotations/instances_val2017.json" \
  42. --noamp \
  43. --use_batched_nms \
  44. --xla \
  45. --nouse_custom_box_proposals_op