remove the reduce fusion config of resnet18.

This commit is contained in:
jiangzhenguang 2021-03-01 19:03:54 +08:00
parent 569e679c66
commit 81706e21ad
4 changed files with 21 additions and 20 deletions

View File

@ -492,8 +492,8 @@ result: {'top_5_accuracy': 0.9342589628681178, 'top_1_accuracy': 0.7680657810499
| Loss Function | Softmax Cross Entropy |
| outputs | probability |
| Loss | 0.0002519517 |
| Speed | 10 ms/step8pcs |
| Total time | 3 mins |
| Speed | 13 ms/step8pcs |
| Total time | 4 mins |
| Parameters (M) | 11.2 |
| Checkpoint for Fine tuning | 86M (.ckpt file) |
| Scripts | [Link](https://gitee.com/mindspore/mindspore/tree/master/model_zoo/official/cv/resnet) |
@ -512,8 +512,8 @@ result: {'top_5_accuracy': 0.9342589628681178, 'top_1_accuracy': 0.7680657810499
| Loss Function | Softmax Cross Entropy |
| outputs | probability |
| Loss | 2.15702 |
| Speed | 140ms/step8pcs |
| Total time | 131 mins |
| Speed | 110ms/step8pcs (may need to set_numa_enbale in dataset.py) |
| Total time | 110 mins |
| Parameters (M) | 11.7 |
| Checkpoint for Fine tuning | 90M (.ckpt file) |
| Scripts | [Link](https://gitee.com/mindspore/mindspore/tree/master/model_zoo/official/cv/resnet) |

View File

@ -459,8 +459,8 @@ result:{'top_5_accuracy':0.9342589628681178, 'top_1_accuracy':0.768065781049936}
| 损失函数 | Softmax交叉熵 |
| 输出 | 概率 |
| 损失 | 0.0002519517 |
| 速度 | 10毫秒/步8卡 |
| 总时长 | 3分钟 |
| 速度 | 13毫秒/步8卡 |
| 总时长 | 4分钟 |
| 参数(M) | 11.2 |
| 微调检查点 | 86.ckpt文件 |
| 脚本 | [链接](https://gitee.com/mindspore/mindspore/tree/master/model_zoo/official/cv/resnet) |
@ -479,8 +479,8 @@ result:{'top_5_accuracy':0.9342589628681178, 'top_1_accuracy':0.768065781049936}
| 损失函数 | Softmax交叉熵 |
| 输出 | 概率 |
| 损失 | 2.15702 |
| 速度 | 140毫秒/步8卡 |
| 总时长 | 131分钟 |
| 速度 | 110毫秒/步8卡 (可能需要在datasetpy中增加set_numa_enbale绑核操作) |
| 总时长 | 110分钟 |
| 参数(M) | 11.7 |
| 微调检查点| 90M.ckpt文件 |
| 脚本 | [链接](https://gitee.com/mindspore/mindspore/tree/master/model_zoo/official/cv/resnet) |

View File

@ -176,8 +176,8 @@ class ResidualBlock(nn.Cell):
in_channel (int): Input channel.
out_channel (int): Output channel.
stride (int): Stride size for the first convolutional layer. Default: 1.
use_se (bool): enable SE-ResNet50 net. Default: False.
se_block(bool): use se block in SE-ResNet50 net. Default: False.
use_se (bool): Enable SE-ResNet50 net. Default: False.
se_block(bool): Use se block in SE-ResNet50 net. Default: False.
Returns:
Tensor, output tensor.
@ -276,8 +276,9 @@ class ResidualBlockBase(nn.Cell):
in_channel (int): Input channel.
out_channel (int): Output channel.
stride (int): Stride size for the first convolutional layer. Default: 1.
use_se (bool): enable SE-ResNet50 net. Default: False.
se_block(bool): use se block in SE-ResNet50 net. Default: False.
use_se (bool): Enable SE-ResNet50 net. Default: False.
se_block(bool): Use se block in SE-ResNet50 net. Default: False.
res_base (bool): Enable parameter setting of resnet18. Default: True.
Returns:
Tensor, output tensor.
@ -290,9 +291,9 @@ class ResidualBlockBase(nn.Cell):
in_channel,
out_channel,
stride=1,
res_base=True,
use_se=False,
se_block=False):
se_block=False,
res_base=True):
super(ResidualBlockBase, self).__init__()
self.res_base = res_base
self.conv1 = _conv3x3(in_channel, out_channel, stride=stride, res_base=self.res_base)
@ -341,8 +342,10 @@ class ResNet(nn.Cell):
out_channels (list): Output channel in each layer.
strides (list): Stride size in each layer.
num_classes (int): The number of classes that the training images are belonging to.
use_se (bool): enable SE-ResNet50 net. Default: False.
se_block(bool): use se block in SE-ResNet50 net in layer 3 and layer 4. Default: False.
use_se (bool): Enable SE-ResNet50 net. Default: False.
se_block(bool): Use se block in SE-ResNet50 net in layer 3 and layer 4. Default: False.
res_base (bool): Enable parameter setting of resnet18. Default: True.
Returns:
Tensor, output tensor.
@ -432,7 +435,7 @@ class ResNet(nn.Cell):
in_channel (int): Input channel.
out_channel (int): Output channel.
stride (int): Stride size for the first convolutional layer.
se_block(bool): use se block in SE-ResNet50 net. Default: False.
se_block(bool): Use se block in SE-ResNet50 net. Default: False.
Returns:
SequentialCell, the output layer.

View File

@ -110,9 +110,7 @@ if __name__ == '__main__':
set_algo_parameters(elementwise_op_strategy_follow=True)
if args_opt.net == "resnet50" or args_opt.net == "se-resnet50":
context.set_auto_parallel_context(all_reduce_fusion_config=[85, 160])
elif args_opt.net == "resnet18":
context.set_auto_parallel_context(all_reduce_fusion_config=[40, 61])
else:
elif args_opt.net == "resnet101":
context.set_auto_parallel_context(all_reduce_fusion_config=[180, 313])
init()
# GPU target