forked from mindspore-Ecosystem/mindspore
!5196 fix bug for yolov3-resnet18 scripts
Merge pull request !5196 from chengxb7532/master
This commit is contained in:
commit
8e04ce04d3
|
@ -36,18 +36,22 @@ ANNO_PATH=$5
|
||||||
PRE_TRAINED=$7
|
PRE_TRAINED=$7
|
||||||
PRE_TRAINED_EPOCH_SIZE=$8
|
PRE_TRAINED_EPOCH_SIZE=$8
|
||||||
|
|
||||||
|
BASE_PATH=$(cd "`dirname $0`" || exit; pwd)
|
||||||
|
cd $BASE_PATH/../ || exit
|
||||||
|
|
||||||
# Before start distribute train, first create mindrecord files.
|
# Before start distribute train, first create mindrecord files.
|
||||||
python train.py --only_create_dataset=1 --mindrecord_dir=$MINDRECORD_DIR --image_dir=$IMAGE_DIR \
|
python train.py --only_create_dataset=1 --mindrecord_dir=$MINDRECORD_DIR --image_dir=$IMAGE_DIR \
|
||||||
--anno_path=$ANNO_PATH
|
--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"
|
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_TABLE_FILE=$6
|
||||||
export RANK_SIZE=$1
|
export RANK_SIZE=$1
|
||||||
|
|
||||||
BASE_PATH=$(cd "`dirname $0`" || exit; pwd)
|
|
||||||
cd $BASE_PATH/../ || exit
|
|
||||||
|
|
||||||
for((i=0;i<RANK_SIZE;i++))
|
for((i=0;i<RANK_SIZE;i++))
|
||||||
do
|
do
|
||||||
export DEVICE_ID=$i
|
export DEVICE_ID=$i
|
||||||
|
|
|
@ -115,7 +115,8 @@ def main():
|
||||||
8)
|
8)
|
||||||
print("Create Mindrecord Done, at {}".format(args_opt.mindrecord_dir))
|
print("Create Mindrecord Done, at {}".format(args_opt.mindrecord_dir))
|
||||||
else:
|
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:
|
if not args_opt.only_create_dataset:
|
||||||
loss_scale = float(args_opt.loss_scale)
|
loss_scale = float(args_opt.loss_scale)
|
||||||
|
|
Loading…
Reference in New Issue