Skip to content
Snippets Groups Projects
Commit 37dca0bb authored by l00486551's avatar l00486551
Browse files

fix vgg19 readme and add single train shell

parent 4bd3e376
No related branches found
No related tags found
No related merge requests found
......@@ -109,6 +109,8 @@ VGG 19网络主要由几个基本模块(包括卷积层和池化层)和三
```python
# 训练示例
bash run_standalone_train_ascend.sh [YAML_CONFIG_PATH] [DATA_PATH]
python train.py --config_path=[YAML_CONFIG_PATH] --data_dir=[DATA_PATH] --dataset=[DATASET_TYPE] > output.train.log 2>&1 &
# 分布式训练示例
......@@ -386,14 +388,14 @@ has_dropout: True # 是否使用Dropout层
```bash
num_classes: 1000 # 数据集类数
lr: 0.01 # 学习率
lr: 0.04 # 学习率
lr_init: 0.01 # 初始学习率
lr_max: 0.1 # 最大学习率
lr_epochs: '30,60,90,120' # 基于变化lr的轮次
lr_scheduler: "cosine_annealing" # 学习率模式
warmup_epochs: 0 # 热身轮次数
batch_size: 32 # 输入张量的批次大小
max_epoch: 150 # 只对训练有效,推理固定值为1
batch_size: 64 # 输入张量的批次大小
max_epoch: 90 # 只对训练有效,推理固定值为1
momentum: 0.9 # 动量
weight_decay: 1e-4 # 权重衰减
loss_scale: 1024 # 损失放大
......@@ -403,7 +405,7 @@ buffer_size: 10 # 混洗缓冲区大小
image_size: '224,224' # 图像大小
pad_mode: 'pad' # conv2d的填充方式
padding: 1 # conv2d的填充值
has_bias: True # conv2d是否有偏差
has_bias: False # conv2d是否有偏差
batch_norm: False # 在conv2d中是否有batch_norm
keep_checkpoint_max: 10 # 只保留最后一个keep_checkpoint_max检查点
initialize_mode: "KaimingNormal" # conv2d init模式
......
#!/bin/bash
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
# an simple tutorial as follows, more parameters can be setting
CONFIG=$1
DATA_PATH=$2
if [ $# != 2 ]
then
echo "Usage: bash run_standalone_train_ascend.sh [YAML_CONFIG_PATH] [DATA_PATH]"
exit 1
fi
if [ ! -f $1 ]
then
echo "error: config_path=$CONFIG is not a file."
exit 1
fi
if [ ! -d $2 ]
then
echo "error: data_dir=$DATA_PATH is not a directory."
exit 1
fi
python ../train.py --config_path=$CONFIG --data_dir=$DATA_PATH > log.txt 2>&1 &
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment