提交 3cfb8e72 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!571 optimize mindwizard network templates

Merge pull request !571 from liangyongxiong/wizard
......@@ -4,7 +4,7 @@
## 介绍
MindWizard是一款快速生成经典网络脚本的工具。工具根据用户选择,组合模型、超参、数据集等网络参数,自动生成目标网络脚本,生成的网络脚本可以在Ascend或GPU等环境上进行训练和推理
MindWizard是一款快速生成经典网络脚本的工具。工具根据用户选择,组合模型、超参、数据集等网络参数,自动生成目标网络脚本,生成的网络脚本可以在Ascend或GPU等环境上进行训练和评估
## 安装
......@@ -33,7 +33,7 @@ optional arguments:
2. 请选择数据集(MNIST / Cifar10 / ImageNet / ...)
生成脚本后,用户可执行训练和推理,详细介绍可参考网络脚本工程中的README。
生成脚本后,用户可执行训练和评估,详细介绍可参考网络脚本工程中的README。
## 网络脚本工程结构
......@@ -42,14 +42,14 @@ project
|- script
| |- run_standalone_train.sh # 单卡训练脚本
| |- run_distribute_train.sh # 多卡训练脚本
| |- run_eval.sh # 推理脚本
| |- run_eval.sh # 评估脚本
| |- ...
|- src
| |- config.py # 参数配置
| |- dataset.py # 数据集处理
| |- lenet.py/resent.py/... # 网络定义
| |- ...
|- eval.py # 网络推理
|- eval.py # 网络评估
|- train.py # 网络训练
|- README.md
```
......
......@@ -45,6 +45,7 @@ class SourceFile:
fp.write(self.content)
try:
shutil.copymode(self.template_file_path, new_file_path)
os.chmod(new_file_path, stat.S_IRUSR | stat.S_IWUSR)
self.set_writeable(new_file_path)
if new_file_path.endswith('.sh'):
self.set_executable(new_file_path)
......
......@@ -67,7 +67,6 @@ do
rm -rf ./train_parallel$i
mkdir ./train_parallel$i
cp ../*.py ./train_parallel$i
cp *.sh ./train_parallel$i
cp -r ../src ./train_parallel$i
cd ./train_parallel$i || exit
echo "start training for rank $RANK_ID, device $DEVICE_ID"
......
......@@ -54,7 +54,6 @@ export RANK_SIZE=$DEVICE_NUM
rm -rf ./train_parallel
mkdir ./train_parallel
cp ../*.py ./train_parallel
cp *.sh ./train_parallel
cp -r ../src ./train_parallel
cd ./train_parallel || exit
echo "start training"
......
......@@ -56,7 +56,6 @@ then
fi
mkdir ./eval
cp ../*.py ./eval
cp *.sh ./eval
cp -r ../src ./eval
cd ./eval || exit
env > env.log
......
......@@ -57,7 +57,6 @@ then
fi
mkdir ./eval
cp ../*.py ./eval
cp *.sh ./eval
cp -r ../src ./eval
cd ./eval || exit
env > env.log
......
......@@ -59,7 +59,6 @@ then
fi
mkdir ./train
cp ../*.py ./train
cp *.sh ./train
cp -r ../src ./train
cd ./train || exit
echo "start training for device $DEVICE_ID"
......
......@@ -59,7 +59,6 @@ then
fi
mkdir ./train
cp ../*.py ./train
cp *.sh ./train
cp -r ../src ./train
cd ./train || exit
echo "start training"
......
......@@ -28,7 +28,7 @@ cfg = edict({
'lr': 0.002,
"momentum": 0.9,
{% elif optimizer=='SGD' %}
'lr': 0.1,
'lr': 0.01,
{% else %}
'lr': 0.001,
{% endif %}
......
......@@ -68,7 +68,6 @@ do
rm -rf ./train_parallel$i
mkdir ./train_parallel$i
cp ../*.py ./train_parallel$i
cp *.sh ./train_parallel$i
cp -r ../src ./train_parallel$i
cd ./train_parallel$i || exit
echo "start training for rank $RANK_ID, device $DEVICE_ID"
......
......@@ -53,7 +53,6 @@ export RANK_SIZE=$DEVICE_NUM
rm -rf ./train_parallel
mkdir ./train_parallel
cp ../*.py ./train_parallel
cp *.sh ./train_parallel
cp -r ../src ./train_parallel
cd ./train_parallel || exit
......
......@@ -56,7 +56,6 @@ then
fi
mkdir ./eval
cp ../*.py ./eval
cp *.sh ./eval
cp -r ../src ./eval
cd ./eval || exit
env > env.log
......
......@@ -57,7 +57,6 @@ then
fi
mkdir ./eval
cp ../*.py ./eval
cp *.sh ./eval
cp -r ../src ./eval
cd ./eval || exit
env > env.log
......
......@@ -60,7 +60,6 @@ then
fi
mkdir ./train
cp ../*.py ./train
cp *.sh ./train
cp -r ../src ./train
cd ./train || exit
echo "start training for device $DEVICE_ID"
......
......@@ -61,7 +61,6 @@ then
fi
mkdir ./train
cp ../*.py ./train
cp *.sh ./train
cp -r ../src ./train
cd ./train || exit
......
......@@ -23,7 +23,7 @@ cfg = edict({
'lr': 0.01,
"momentum": 0.9,
{% elif optimizer=='SGD' %}
'lr': 0.1,
'lr': 0.01,
{% else %}
'lr': 0.001,
{% endif %}
......
......@@ -67,7 +67,6 @@ do
rm -rf ./train_parallel$i
mkdir ./train_parallel$i
cp ../*.py ./train_parallel$i
cp *.sh ./train_parallel$i
cp -r ../src ./train_parallel$i
cd ./train_parallel$i || exit
echo "start training for rank $RANK_ID, device $DEVICE_ID"
......
......@@ -54,7 +54,6 @@ export RANK_SIZE=$DEVICE_NUM
rm -rf ./train_parallel
mkdir ./train_parallel
cp ../*.py ./train_parallel
cp *.sh ./train_parallel
cp -r ../src ./train_parallel
cd ./train_parallel || exit
......
......@@ -56,7 +56,6 @@ then
fi
mkdir ./eval
cp ../*.py ./eval
cp *.sh ./eval
cp -r ../src ./eval
cd ./eval || exit
env > env.log
......
......@@ -57,7 +57,6 @@ then
fi
mkdir ./eval
cp ../*.py ./eval
cp *.sh ./eval
cp -r ../src ./eval
cd ./eval || exit
env > env.log
......
......@@ -59,7 +59,6 @@ then
fi
mkdir ./train
cp ../*.py ./train
cp *.sh ./train
cp -r ../src ./train
cd ./train || exit
echo "start training for device $DEVICE_ID"
......
......@@ -59,7 +59,6 @@ then
fi
mkdir ./train
cp ../*.py ./train
cp *.sh ./train
cp -r ../src ./train
cd ./train || exit
echo "start training"
......
......@@ -30,7 +30,7 @@ cfg = ed({
"momentum": 0.9,
"lr": 0.01,
{% elif optimizer=='SGD' %}
'lr': 0.1,
'lr': 0.01,
{% else %}
'lr': 0.001,
{% endif %}
......
......@@ -91,6 +91,7 @@ class CreateProject(BaseCommand):
if not choice:
click.secho(textwrap.dedent("Network is required."), fg='red')
click.secho(textwrap.dedent("Your choice is %s." % network_type_choices[choice - 1]), fg='yellow')
return network_type_choices[choice - 1]
@staticmethod
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册