Browse Source

!5196 fix bug for yolov3-resnet18 scripts

Merge pull request !5196 from chengxb7532/master
tags/v1.0.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
8e04ce04d3
2 changed files with 9 additions and 4 deletions
  1. +7
    -3
      model_zoo/official/cv/yolov3_resnet18/scripts/run_distribute_train.sh
  2. +2
    -1
      model_zoo/official/cv/yolov3_resnet18/train.py

+ 7
- 3
model_zoo/official/cv/yolov3_resnet18/scripts/run_distribute_train.sh View File

@@ -36,18 +36,22 @@ ANNO_PATH=$5
PRE_TRAINED=$7
PRE_TRAINED_EPOCH_SIZE=$8

BASE_PATH=$(cd "`dirname $0`" || exit; pwd)
cd $BASE_PATH/../ || exit

# Before start distribute train, first create mindrecord files.
python train.py --only_create_dataset=1 --mindrecord_dir=$MINDRECORD_DIR --image_dir=$IMAGE_DIR \
--anno_path=$ANNO_PATH
if [ $? -ne 0 ]
then
exit 1
fi

echo "After running the scipt, the network runs in the background. The log will be generated in LOGx/log.txt"

export RANK_TABLE_FILE=$6
export RANK_SIZE=$1

BASE_PATH=$(cd "`dirname $0`" || exit; pwd)
cd $BASE_PATH/../ || exit

for((i=0;i<RANK_SIZE;i++))
do
export DEVICE_ID=$i


+ 2
- 1
model_zoo/official/cv/yolov3_resnet18/train.py View File

@@ -115,7 +115,8 @@ def main():
8)
print("Create Mindrecord Done, at {}".format(args_opt.mindrecord_dir))
else:
print("image_dir or anno_path not exits.")
raise ValueError('image_dir {} or anno_path {} does not exist'.format(\
args_opt.image_dir, args_opt.anno_path))

if not args_opt.only_create_dataset:
loss_scale = float(args_opt.loss_scale)


Loading…
Cancel
Save