华为MindSpore平台下深度模型云端训练自动化

在华为MindSpore平台下深度模型云端训练自动化后端功能实现

### 华为MindSpore平台下深度模型云端训练自动化


后端功能实现:收到前端的的数据有任务类型,数据集,训练参数等


1.创建两个脚本文件run_train_detection.sh和run_train_semantic.sh分别对应目标检测和语义分割两种训练方式


export DEVICE_ID=0

export SLOG_PRINT_TO_STDOUT=0


# save path 


export train_path=/home/ma-user/work/lh/semantic/train_dir


# train.py path


export train_code_path=/home/ma-user/work/lh/DeepLabv3plus_for_MindSpore_1.1_code_new


mkdir -p ${train_path}

mkdir ${train_path}/device${DEVICE_ID}

mkdir ${train_path}/ckpt

cd ${train_path}/device${DEVICE_ID} || exit


python ${train_code_path}/train.py --data_file=/home/ma-user/work/lh/semantic/train/mindsporetest  \

                    --train_dir=${train_path}/ckpt  \

                    --train_epochs=<epochs> \

                    --batch_size=32  \

                    --crop_size=513  \

                    --base_lr=<lr>  \

                    --lr_type=cos  \

                    --min_scale=0.5  \

                    --max_scale=2.0  \

                    --ignore_label=255  \

                    --num_classes=20  \

                    --model=DeepLabV3plus_s16  \

                    --ckpt_pre_trained=  \

                    --save_steps=1500  \

                    --keep_checkpoint_max=200 >log 2>&1 &  

包含训练路径,数据集路径,模型保存路径,常见训练参数等等

2.创建一个.sh文件用来接受前端参数并修改训练脚本文件

命令:sed -i 's/<epochs>/200/' run_train_semantic.sh

用来修改对应的训练参数,学习率等参数

命令:bash run_train_semantic.sh 

启动训练

你可能感兴趣的文章

相关问题

0 条评论

请先 登录 后评论
LH
LH

14 篇文章

作家榜 »

  1. Panda-admin 37 文章
  2. 解弘艺 17 文章
  3. 高曾谊 16 文章
  4. 胡中天 14 文章
  5. 旺仔牛奶opo 14 文章
  6. LH 14 文章
  7. 罗柏荣 13 文章
  8. 林晨 12 文章