From: @yuchaojie Reviewed-by: @chenfei52 Signed-off-by:tags/v1.1.0
| @@ -102,10 +102,10 @@ MobileNetV2总体网络架构如下: | |||||
| - 配置MobileNetV2-quant和ImageNet2012数据集。 | - 配置MobileNetV2-quant和ImageNet2012数据集。 | ||||
| ```python | ```python | ||||
| 'class_num':1000 # 数据集类数 | |||||
| 'num_classes':1000 # 数据集类数 | |||||
| 'batch_size':134 # 训练批次大小 | 'batch_size':134 # 训练批次大小 | ||||
| 'epoch_size':60 # Mobilenetv2-quant的训练轮次 | |||||
| 'start epoch':200 # 非量化网络预训练轮次 | |||||
| 'epoch_size':60 # Mobilenetv2-quant的训练轮次 | |||||
| 'start_epoch':200 # 非量化网络预训练轮次 | |||||
| 'warmup_epochs':0 # 热身轮次 | 'warmup_epochs':0 # 热身轮次 | ||||
| 'lr':0.3 # 学习率 | 'lr':0.3 # 学习率 | ||||
| 'momentum':0.9 # 动量 | 'momentum':0.9 # 动量 | ||||
| @@ -92,10 +92,10 @@ Parameters for both training and evaluation can be set in config.py | |||||
| - config for MobileNetV2-quant, ImageNet2012 dataset | - config for MobileNetV2-quant, ImageNet2012 dataset | ||||
| ```python | ```python | ||||
| 'class_num': 1000 # the number of classes in the dataset | |||||
| 'num_classes': 1000 # the number of classes in the dataset | |||||
| 'batch_size': 134 # training batch size | 'batch_size': 134 # training batch size | ||||
| 'epoch_size': 60 # training epochs of mobilenetv2-quant | |||||
| 'start epoch':200 # pretraining epochs of unquantative network | |||||
| 'epoch_size': 60 # training epochs of mobilenetv2-quant | |||||
| 'start_epoch':200 # pretraining epochs of unquantative network | |||||
| 'warmup_epochs': 0 # number of warmup epochs | 'warmup_epochs': 0 # number of warmup epochs | ||||
| 'lr': 0.3 #learning rate | 'lr': 0.3 #learning rate | ||||
| 'momentum': 0.9 # momentum | 'momentum': 0.9 # momentum | ||||
| @@ -24,7 +24,7 @@ config_ascend_quant = ed({ | |||||
| "data_load_mode": "mindata", | "data_load_mode": "mindata", | ||||
| "epoch_size": 60, | "epoch_size": 60, | ||||
| "start_epoch": 200, | "start_epoch": 200, | ||||
| "warmup_epochs": 1, | |||||
| "warmup_epochs": 0, | |||||
| "lr": 0.3, | "lr": 0.3, | ||||
| "momentum": 0.9, | "momentum": 0.9, | ||||
| "weight_decay": 4e-5, | "weight_decay": 4e-5, | ||||
| @@ -34,7 +34,6 @@ config_ascend_quant = ed({ | |||||
| "save_checkpoint_epochs": 1, | "save_checkpoint_epochs": 1, | ||||
| "keep_checkpoint_max": 300, | "keep_checkpoint_max": 300, | ||||
| "save_checkpoint_path": "./checkpoint", | "save_checkpoint_path": "./checkpoint", | ||||
| "quantization_aware": True, | |||||
| }) | }) | ||||
| config_gpu_quant = ed({ | config_gpu_quant = ed({ | ||||
| @@ -42,7 +41,7 @@ config_gpu_quant = ed({ | |||||
| "batch_size": 134, | "batch_size": 134, | ||||
| "epoch_size": 60, | "epoch_size": 60, | ||||
| "start_epoch": 200, | "start_epoch": 200, | ||||
| "warmup_epochs": 1, | |||||
| "warmup_epochs": 0, | |||||
| "lr": 0.3, | "lr": 0.3, | ||||
| "momentum": 0.9, | "momentum": 0.9, | ||||
| "weight_decay": 4e-5, | "weight_decay": 4e-5, | ||||
| @@ -50,7 +50,6 @@ config_ascend_quant = ed({ | |||||
| "save_checkpoint_epochs": 1, | "save_checkpoint_epochs": 1, | ||||
| "keep_checkpoint_max": 300, | "keep_checkpoint_max": 300, | ||||
| "save_checkpoint_path": "./checkpoint", | "save_checkpoint_path": "./checkpoint", | ||||
| "quantization_aware": True, | |||||
| }) | }) | ||||
| dataset_path = "/home/workspace/mindspore_dataset/cifar-10-batches-bin/" | dataset_path = "/home/workspace/mindspore_dataset/cifar-10-batches-bin/" | ||||