diff --git a/official/cv/lenet/README.md b/official/cv/lenet/README.md index 6d16494764fb26c1bdeb48526d0ce93182484b22..44878555df603f5bdeec388e8f1fce8536830501 100644 --- a/official/cv/lenet/README.md +++ b/official/cv/lenet/README.md @@ -18,13 +18,11 @@ - [Infer on Ascend310](#infer-on-ascend310) - [result](#result) - [Apply algorithm in MindSpore Golden Stick](#apply-algorithm-in-mindspore-golden-stick) - - [Training Process](#Training Process-1) + - [Training Process](#training-process-1) - [Running on GPU](#running-on-gpu-1) - [Evaluation Process](#evaluation-process-1) - [Running on GPU](#running-on-gpu-2) - - [Result](#resutl-3) - - [Inference Process](#inference-process-1) - - [Export MindIR](#export-mindir-1) + - [Result](#result-3) - [Model Description](#model-description) - [Performance](#performance) - [Evaluation Performance](#evaluation-performance) @@ -340,12 +338,6 @@ Evaluation result will be stored in the example path, whose folder name is "eval ================ {'Accuracy': 0.9907852564102564} ================ ``` -## Inference Process - -### Export MindIR - -Not support exporting MindIR now. - ## [Model Description](#contents) ### [Performance](#contents) diff --git a/official/cv/lenet/README_CN.md b/official/cv/lenet/README_CN.md index 9211a4e4eb1d0490652dedaf412e0bf61d83ca6e..de9821bcd66c772d412d5638186b67f913d22f10 100644 --- a/official/cv/lenet/README_CN.md +++ b/official/cv/lenet/README_CN.md @@ -25,8 +25,6 @@ - [评估过程](#评估过程-1) - [GPU处理器环境运行](#gpu处理器环境运行-1) - [结果](#结果-3) - - [推理过程](#推理过程-1) - - [导出MindIR](#导出mindir-1) - [模型描述](#模型描述) - [性能](#性能) - [评估性能](#评估性能) @@ -342,12 +340,6 @@ bash run_eval_gpu.sh ../quantization/simqat/ ../quantization/simqat/lenet_mnist_ ================ {'Accuracy': 0.9907852564102564} ================ ``` -## 推理过程 - -### 导出MindIR - -当前暂不支持导出MindIR。 - ## 模型描述 ## 性能 diff --git a/official/cv/resnet/README.md b/official/cv/resnet/README.md index 32a55437cf381a22d552a013dd9f2416e2ac45a0..69bcc46a3d48f2f7616d62d34f813f119e6a7878 100644 --- a/official/cv/resnet/README.md +++ b/official/cv/resnet/README.md @@ -30,13 +30,11 @@ - [Infer on Ascend310](#infer-on-ascend310) - [result](#result-2) - [Apply algorithm in MindSpore Golden Stick](#apply-algorithm-in-mindspore-golden-stick) - - [Training Process](#Training Process-1) + - [Training Process](#training-process-1) - [Running on GPU](#running-on-gpu-2) - [Evaluation Process](#evaluation-process-1) - [Running on GPU](#running-on-gpu-3) - - [Result](#resutl-3) - - [Inference Process](#inference-process-1) - - [Export MindIR](#export-mindir-1) + - [Result](#result-3) - [Model Description](#model-description) - [Performance](#performance) - [Evaluation Performance](#evaluation-performance) @@ -918,12 +916,6 @@ result:{'top_1_accuracy': 0.8976362179487182, 'top_5_accuracy': 0.99238782051282 result:{'top_1_accuracy': 0.8845152243589743, 'top_5_accuracy': 0.9914863782051282} ckpt=~/resnet18_cifar10/train_parallel/resnet-100_1562.ckpt ``` -## Inference Process - -### Export MindIR - -Not support exporting MindIR now. - # [Model Description](#contents) ## [Performance](#contents) diff --git a/official/cv/resnet/README_CN.md b/official/cv/resnet/README_CN.md index f77b5f97cf73f9bb00ac143ddf56e16e7056fb85..aab9f8e3531276d6821c3e2388818b6e37e42331 100644 --- a/official/cv/resnet/README_CN.md +++ b/official/cv/resnet/README_CN.md @@ -38,8 +38,6 @@ - [评估过程](#评估过程-1) - [GPU处理器环境运行](#gpu处理器环境运行-3) - [结果](#结果-3) - - [推理过程](#推理过程-1) - - [导出MindIR](#导出mindir-1) - [模型描述](#模型描述) - [性能](#性能) - [评估性能](#评估性能) @@ -880,12 +878,6 @@ result:{'top_1_accuracy': 0.8976362179487182, 'top_5_accuracy': 0.99238782051282 result:{'top_1_accuracy': 0.8845152243589743, 'top_5_accuracy': 0.9914863782051282} ckpt=~/resnet18_cifar10/train_parallel/resnet-100_1562.ckpt ``` -## 推理过程 - -### 导出MindIR - -当前暂不支持导出MindIR。 - # 模型描述 ## 性能 diff --git a/official/cv/resnet/golden_stick/quantization/slb/train.py b/official/cv/resnet/golden_stick/quantization/slb/train.py index 55a47dbe05c022e5a7897147fbc091b38219d16e..c5ca73648249511c86031cff17a802262ed973c6 100644 --- a/official/cv/resnet/golden_stick/quantization/slb/train.py +++ b/official/cv/resnet/golden_stick/quantization/slb/train.py @@ -183,9 +183,11 @@ class TemperatureScheduler(callback.Callback): """ TemperatureScheduler for SLB. """ - def __init__(self, model, epoch_size=100, t_start_val=1.0, t_start_time=0.2, t_end_time=0.6, t_factor=1.2): + def __init__(self, model, epoch_size=100, has_trained_epoch=0, + t_start_val=1.0, t_start_time=0.2, t_end_time=0.6, t_factor=1.2): super().__init__() self.epochs = epoch_size + self.has_trained_epoch = has_trained_epoch self.t_start_val = t_start_val self.t_start_time = t_start_time self.t_end_time = t_end_time @@ -197,7 +199,7 @@ class TemperatureScheduler(callback.Callback): Epoch_begin. """ cb_params = run_context.original_args() - epoch = cb_params.cur_epoch_num + epoch = cb_params.cur_epoch_num + self.has_trained_epoch # Compute temperature value t = self.t_start_val t_start_epoch = int(self.epochs*self.t_start_time) @@ -208,9 +210,8 @@ class TemperatureScheduler(callback.Callback): for _, cell in self.model.train_network.cells_and_names(): if cell.cls_name == 'QBNNFakeQuantizerPerLayer': # for QBNN cell.set_temperature(t) - if epoch == t_end_epoch: + if epoch >= t_end_epoch: cell.set_temperature_end_flag() - print('Temperature stops changing. Start applying one-hot to latent weights.') def train_net(): @@ -266,7 +267,7 @@ def train_net(): if algo: algo_cb = algo.callback() cb.append(algo_cb) - cb.append(TemperatureScheduler(model, config.epoch_size, config.t_start_val, + cb.append(TemperatureScheduler(model, config.epoch_size, config.has_trained_epoch, config.t_start_val, config.t_start_time, config.t_end_time, config.t_factor)) ckpt_save_dir = set_save_ckpt_dir() if config.save_checkpoint: