@ -46,8 +46,8 @@ For FP16 operators, if the input data type is FP32, the backend of MindSpore wil
# [Environment Requirements](#contents)
- Hardware(Ascend/GPU)
- Prepare hardware environment with Ascend or GPU processor. If you want to try Ascend, please send the [application form](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/file/other/Ascend%20Model%20Zoo%E4%BD%93%E9%AA%8C%E8%B5%84%E6%BA%90%E7%94%B3%E8%AF%B7%E8%A1%A8.docx) to ascend@huawei.com. Once approved, you can get the resources.
- Hardware(Ascend)
- Prepare hardware environment with Ascend. If you want to try Ascend, please send the [application form](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/file/other/Ascend%20Model%20Zoo%E4%BD%93%E9%AA%8C%E8%B5%84%E6%BA%90%E7%94%B3%E8%AF%B7%E8%A1%A8.docx) to ascend@huawei.com. Once approved, you can get the resources.
│ ├──custom_transforms.py # random process dataset
│ ├──file_io.py # file operation module
│ ├──__init__.py
```
## [Script Parameters](#contents)
@ -107,7 +107,7 @@ Major parameters in train.py and config.py are:
to refine segmentation results, default is None.
image_pyramid Input scales for multi-scale feature extraction, default is None.
epoch_size Epoch size, default is 6.
batch_size batch size of input dataset: N, default is 2.
batch_size Batch size of input dataset: N, default is 2.
enable_save_ckpt Enable save checkpoint, default is true.
save_checkpoint_steps Save checkpoint steps, default is 1000.
save_checkpoint_num Save checkpoint numbers, default is 1.
@ -123,7 +123,7 @@ You can start training using python or shell scripts. The usage of shell scripts
sh scripts/run_distribute_train.sh RANK_TABLE_FILE DATA_PATH (CKPT_PATH)
> Notes:
RANK_TABLE_FILE can refer to [Link](https://www.mindspore.cn/tutorial/en/master/advanced_use/distributed_training_ascend.html) , and the device_ip can be got in /etc/hccn.conf in ascend server.
RANK_TABLE_FILE can refer to [Link](https://www.mindspore.cn/tutorial/en/master/advanced_use/distributed_training_ascend.html) , and the device_ip can be got as https://gitee.com/mindspore/mindspore/tree/master/model_zoo/utils/hccl_tools.
### Launch
@ -133,7 +133,7 @@ sh scripts/run_distribute_train.sh RANK_TABLE_FILE DATA_PATH (CKPT_PATH)
python train.py --dataset_url DATA_PATH
shell:
sh scripts/run_distribute_train.sh RANK_TABLE_FILE DATA_PATH (CKPT_PATH)
sh scripts/run_standalone_train.sh DEVICE_ID DATA_PATH (CKPT_PATH)
```
> Notes:
If you are running a fine-tuning or evaluation task, prepare the corresponding checkpoint file.
@ -171,7 +171,7 @@ sh scripts/run_eval.sh DEVICE_ID DATA_PATH PRETRAINED_CKPT_PATH
### Result
Evaluation result will be stored in the example path, you can find result like the followings in `log.txt`.
Evaluation result will be stored in the example path, you can find result like the followings in `eval.log`.
InceptionV3 by Google is the 3rd version in a series of Deep Learning Convolutional Architectures.
InceptionV3 by Google is the 3rd version in a series of Deep Learning Convolutional Architectures. Inception v3 mainly focuses on burning less computational power by modifying the previous Inception architectures. This idea was proposed in the paper Rethinking the Inception Architecture for Computer Vision, published in 2015.
[Paper](https://arxiv.org/pdf/1512.00567.pdf) Min Sun, Ali Farhadi, Steve Seitz. Ranking Domain-Specific Highlights by Analyzing Edited Videos[J]. 2014.
@ -36,8 +36,8 @@ The overall network architecture of InceptionV3 is show below:
Dataset used can refer to paper.
- Dataset size: ~125G, 1.2W colorful images in 1000 classes
- Train: 120G, 1.2W images
- Test: 5G, 50000 images
- Train: 120G, 1200k images
- Test: 5G, 50k images
- Data format: RGB images.
- Note: Data will be processed in src/dataset.py
@ -68,11 +68,11 @@ For FP16 operators, if the input data type is FP32, the backend of MindSpore wil
├─README.md
├─scripts
├─run_standalone_train.sh # launch standalone training with ascend platform(1p)
├─run_standalone_train_for_gpu.sh # launch standalone training with gpu platform(1p)
├─run_standalone_train_gpu.sh # launch standalone training with gpu platform(1p)
├─run_distribute_train.sh # launch distributed training with ascend platform(8p)
├─run_distribute_train_for_gpu.sh # launch distributed training with gpu platform(8p)
├─run_distribute_train_gpu.sh # launch distributed training with gpu platform(8p)
├─run_eval.sh # launch evaluating with ascend platform
└─run_eval_for_gpu.sh # launch evaluating with gpu platform
└─run_eval_gpu.sh # launch evaluating with gpu platform
├─src
├─config.py # parameter configuration
├─dataset.py # data preprocessing
@ -88,27 +88,32 @@ For FP16 operators, if the input data type is FP32, the backend of MindSpore wil
```python
Major parameters in train.py and config.py are:
'random_seed': 1, # fix random seed
'rank': 0, # local rank of distributed
'group_size': 1, # world size of distributed
'work_nums': 8, # number of workers to read the data
'keep_checkpoint_max': 100, # max numbers to keep checkpoints
'ckpt_path': './checkpoint/', # save checkpoint path
'is_save_on_master': 1 # save checkpoint on rank0, distributed parameters
'random_seed' # fix random seed
'rank' # local rank of distributed
'group_size' # world size of distributed
'work_nums' # number of workers to read the data
'decay_method' # learning rate scheduler mode
"loss_scale" # loss scale
'batch_size' # input batchsize
'epoch_size' # total epoch numbers
'num_classes' # dataset class numbers
'smooth_factor' # label smoothing factor
'aux_factor' # loss factor of aux logit
'lr_init' # initiate learning rate
'lr_max' # max bound of learning rate
'lr_end' # min bound of learning rate
'warmup_epochs' # warmup epoch numbers
'weight_decay' # weight decay
'momentum' # momentum
'opt_eps' # epsilon
'keep_checkpoint_max' # max numbers to keep checkpoints
'ckpt_path' # save checkpoint path
'is_save_on_master' # save checkpoint on rank0, distributed parameters
'dropout_keep_prob' # the keep rate, between 0 and 1, e.g. keep_prob = 0.9, means dropping out 10% of input units
'has_bias' # specifies whether the layer uses a bias vector.
'amp_level' # option for argument `level` in `mindspore.amp.build_train_network`, level for mixed
# precision training. Supports [O0, O2, O3].
```
## [Training process](#contents)
@ -125,13 +130,15 @@ sh run_distribute_train.sh RANK_TABLE_FILE DATA_PATH
# standalone training
sh run_standalone_train.sh DEVICE_ID DATA_PATH
```
> Notes:
RANK_TABLE_FILE can refer to [Link](https://www.mindspore.cn/tutorial/en/master/advanced_use/distributed_training_ascend.html) , and the device_ip can be got as https://gitee.com/mindspore/mindspore/tree/master/model_zoo/utils/hccl_tools.
- GPU:
```
# distribute training example(8p)
sh run_distribute_train_for_gpu.sh DATA_DIR
sh run_distribute_train_gpu.sh DATA_DIR
# standalone training
sh run_standalone_train_for_gpu.sh DEVICE_ID DATA_DIR
sh run_standalone_train_gpu.sh DEVICE_ID DATA_DIR
```
### Launch
@ -143,10 +150,16 @@ sh run_standalone_train_for_gpu.sh DEVICE_ID DATA_DIR