!6267 delete redundant codes in model zoo

Merge pull request !6267 from zhaoting/clean_warnings
pull/6267/MERGE
mindspore-ci-bot 4 years ago committed by Gitee
commit 31ad1654a1

@ -50,7 +50,7 @@ Dataset used: [CIFAR-10](<http://www.cs.toronto.edu/~kriz/cifar.html>)
- HardwareAscend/GPU
- Prepare hardware environment with Ascend or GPU processor.
- Framework
- [MindSpore](http://10.90.67.50/mindspore/archive/20200506/OpenSource/me_vm_x86/)
- [MindSpore](https://www.mindspore.cn/install/en)
- For more information, please check the resources below
- [MindSpore tutorials](https://www.mindspore.cn/tutorial/zh-CN/master/index.html)
- [MindSpore API](https://www.mindspore.cn/api/zh-CN/master/index.html)

@ -13,8 +13,8 @@
# limitations under the License.
# ============================================================================
import cv2
import numpy as np
import cv2
import mindspore.dataset as de
cv2.setNumThreads(0)

@ -114,7 +114,7 @@ class BboxAssignSampleForRcnn(nn.Cell):
bboxes = self.select(self.cast(self.tile(self.reshape(self.cast(valid_mask, mstype.int32), \
(self.num_bboxes, 1)), (1, 4)), mstype.bool_), \
bboxes, self.check_anchor_two)
# 1 dim = gt, 2 dim = bbox
overlaps = self.iou(bboxes, gt_bboxes_i)
max_overlaps_w_gt_index, max_overlaps_w_gt = self.max_gt(overlaps)

@ -166,15 +166,12 @@ if __name__ == '__main__':
parameter_name = x.name
if parameter_name.endswith('.bias'):
# all bias not using weight decay
# print('no decay:{}'.format(parameter_name))
no_decay_params.append(x)
elif parameter_name.endswith('.gamma'):
# bn weight bias not using weight decay, be carefully for now x not include BN
# print('no decay:{}'.format(parameter_name))
no_decay_params.append(x)
elif parameter_name.endswith('.beta'):
# bn weight bias not using weight decay, be carefully for now x not include BN
# print('no decay:{}'.format(parameter_name))
no_decay_params.append(x)
else:
decay_params.append(x)

@ -54,7 +54,7 @@ For FP16 operators, if the input data type is FP32, the backend of MindSpore wil
- HardwareAscend/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.
- Framework
- [MindSpore](http://10.90.67.50/mindspore/archive/20200506/OpenSource/me_vm_x86/)
- [MindSpore](https://www.mindspore.cn/install/en)
- For more information, please check the resources below
- [MindSpore tutorials](https://www.mindspore.cn/tutorial/zh-CN/master/index.html)
- [MindSpore API](https://www.mindspore.cn/api/zh-CN/master/index.html)

@ -56,7 +56,7 @@ Dataset used: [MNIST](<http://yann.lecun.com/exdb/mnist/>)
- HardwareAscend/GPU/CPU
- Prepare hardware environment with Ascend, GPU, or CPU processor.
- Framework
- [MindSpore](http://10.90.67.50/mindspore/archive/20200506/OpenSource/me_vm_x86/)
- [MindSpore](https://www.mindspore.cn/install/en)
- For more information, please check the resources below
- [MindSpore tutorials](https://www.mindspore.cn/tutorial/zh-CN/master/index.html)
- [MindSpore API](https://www.mindspore.cn/api/zh-CN/master/index.html)

@ -22,8 +22,8 @@ class LeNet5(nn.Cell):
Lenet network
Args:
num_class (int): Num classes. Default: 10.
num_channel (int): Num channels. Default: 1.
num_class (int): Number of classes. Default: 10.
num_channel (int): Number of channels. Default: 1.
Returns:
Tensor, output tensor

@ -21,7 +21,7 @@ class LeNet5(nn.Cell):
Lenet network
Args:
num_class (int): Num classes. Default: 10.
num_class (int): Number of classes. Default: 10.
Returns:
Tensor, output tensor

@ -22,7 +22,7 @@ class LeNet5(nn.Cell):
Lenet network
Args:
num_class (int): Num classes. Default: 10.
num_class (int): Number of classes. Default: 10.
Returns:
Tensor, output tensor

@ -118,7 +118,7 @@ class BboxAssignSampleForRcnn(nn.Cell):
bboxes = self.select(self.cast(self.tile(self.reshape(self.cast(valid_mask, mstype.int32), \
(self.num_bboxes, 1)), (1, 4)), mstype.bool_), \
bboxes, self.check_anchor_two)
# 1 dim = gt, 2 dim = bbox
overlaps = self.iou(bboxes, gt_bboxes_i)
max_overlaps_w_gt_index, max_overlaps_w_gt = self.max_gt(overlaps)

@ -51,7 +51,7 @@ For FP16 operators, if the input data type is FP32, the backend of MindSpore wil
- HardwareAscend/GPU/CPU
- Prepare hardware environment with Ascend、GPU or CPU 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.
- Framework
- [MindSpore](http://10.90.67.50/mindspore/archive/20200506/OpenSource/me_vm_x86/)
- [MindSpore](https://www.mindspore.cn/install/en)
- For more information, please check the resources below
- [MindSpore tutorials](https://www.mindspore.cn/tutorial/zh-CN/master/index.html)
- [MindSpore API](https://www.mindspore.cn/api/zh-CN/master/index.html)

@ -145,7 +145,7 @@ class MobileNetV2Backbone(nn.Cell):
MobileNetV2 architecture.
Args:
class_num (Cell): number of classes.
class_num (int): number of classes.
width_mult (int): Channels multiplier for round to 8/16 and others. Default is 1.
has_dropout (bool): Is dropout used. Default is false
inverted_residual_setting (list): Inverted residual settings. Default is None
@ -233,7 +233,7 @@ class MobileNetV2Head(nn.Cell):
MobileNetV2 architecture.
Args:
class_num (Cell): number of classes.
class_num (int): Number of classes. Default is 1000.
has_dropout (bool): Is dropout used. Default is false
Returns:
Tensor, output tensor.
@ -284,11 +284,13 @@ class MobileNetV2(nn.Cell):
MobileNetV2 architecture.
Args:
class_num (Cell): number of classes.
class_num (int): number of classes.
width_mult (int): Channels multiplier for round to 8/16 and others. Default is 1.
has_dropout (bool): Is dropout used. Default is false
inverted_residual_setting (list): Inverted residual settings. Default is None
round_nearest (list): Channel round to . Default is 8
backbone(nn.Cell): Backbone of MobileNetV2.
head(nn.Cell): Classification head of MobileNetV2.
Returns:
Tensor, output tensor.

@ -29,8 +29,8 @@ class CrossEntropyWithLabelSmooth(_Loss):
CrossEntropyWith LabelSmooth.
Args:
smooth_factor (float): smooth factor, default=0.
num_classes (int): num classes
smooth_factor (float): smooth factor. Default is 0.
num_classes (int): number of classes. Default is 1000.
Returns:
None.

@ -83,8 +83,8 @@ class CrossEntropyWithLabelSmooth(_Loss):
CrossEntropyWith LabelSmooth.
Args:
smooth_factor (float): smooth factor, default=0.
num_classes (int): num classes
smooth_factor (float): smooth factor for label smooth. Default is 0.
num_classes (int): number of classes. Default is 1000.
Returns:
None.

@ -45,7 +45,7 @@ Dataset used: [imagenet](http://www.image-net.org/)
- HardwareGPU
- Prepare hardware environment with GPU processor.
- Framework
- [MindSpore](http://10.90.67.50/mindspore/archive/20200506/OpenSource/me_vm_x86/)
- [MindSpore](https://www.mindspore.cn/install/en)
- For more information, please check the resources below
- [MindSpore tutorials](https://www.mindspore.cn/tutorial/zh-CN/master/index.html)
- [MindSpore API](https://www.mindspore.cn/api/zh-CN/master/index.html)

@ -83,7 +83,7 @@ class SE(nn.Cell):
SE warpper definition.
Args:
num_out (int): Output channel.
num_out (int): Numbers of output channels.
ratio (int): middle output ratio.
Returns:
@ -301,7 +301,7 @@ class MobileNetV3(nn.Cell):
def _make_layer(self, kernel_size, exp_ch, out_channel, use_se, act_func, stride=1):
mid_planes = exp_ch
out_planes = out_channel
#num_in, num_mid, num_out, kernel_size, stride=1, act_type='relu', use_se=False):
layer = ResUnit(self.inplanes, mid_planes, out_planes,
kernel_size, stride=stride, act_type=act_func, use_se=use_se)
self.inplanes = out_planes

@ -68,8 +68,8 @@ class CrossEntropyWithLabelSmooth(_Loss):
CrossEntropyWith LabelSmooth.
Args:
smooth_factor (float): smooth factor, default=0.
num_classes (int): num classes
smooth_factor (float): smooth factor for label smooth. Default is 0.
num_classes (int): number of classes. Default is 1000.
Returns:
None.

@ -47,7 +47,6 @@ def create_dataset(dataset_path, config, do_train, repeat_num=1):
C.RandomCropDecodeResize(config.image_size),
C.RandomHorizontalFlip(prob=0.5),
C.RandomColorAdjust(brightness=0.4, saturation=0.5) # fast mode
# C.RandomColorAdjust(brightness=0.4, contrast=0.5, saturation=0.5, hue=0.2)
]
else:
trans = [

@ -151,7 +151,7 @@ class _DatasetIter:
class _DatasetIterMSLoopSink(_DatasetIter):
"""Iter for context (device_target=Ascend)"""
"""Iter for context when device_target is Ascend"""
def __init__(self, dataset, sink_size, epoch_num, iter_first_order):
super().__init__(dataset, sink_size, epoch_num)
sink_count = 1
@ -179,7 +179,7 @@ class _DatasetIterMSLoopSink(_DatasetIter):
class _DatasetIterMS(_DatasetIter):
"""Iter for MS(enable_loop_sink=False)."""
"""Iter for MS when enable_loop_sink is False."""
def __init__(self, dataset, sink_size, epoch_num):
super().__init__(dataset, sink_size, epoch_num)
if sink_size > 0:

@ -283,7 +283,7 @@ class ResNet(nn.Cell):
frequency=frequency, batch_size=batch_size)
self.bn1 = _bn(64)
self.relu = P.ReLU()
# self.maxpool = P.MaxPoolWithArgmax(padding="same", ksize=3, strides=2)
self.maxpool = nn.MaxPool2d(kernel_size=3, stride=2, pad_mode="same")
self.layer1 = self._make_layer(block,

@ -56,7 +56,7 @@ For FP16 operators, if the input data type is FP32, the backend of MindSpore wil
- HardwareAscend/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.
- Framework
- [MindSpore](http://10.90.67.50/mindspore/archive/20200506/OpenSource/me_vm_x86/)
- [MindSpore](https://www.mindspore.cn/install/en)
- For more information, please check the resources below
- [MindSpore tutorials](https://www.mindspore.cn/tutorial/zh-CN/master/index.html)
- [MindSpore API](https://www.mindspore.cn/api/zh-CN/master/index.html)

@ -23,15 +23,12 @@ def get_param_groups(network):
parameter_name = x.name
if parameter_name.endswith('.bias'):
# all bias not using weight decay
# print('no decay:{}'.format(parameter_name))
no_decay_params.append(x)
elif parameter_name.endswith('.gamma'):
# bn weight bias not using weight decay, be carefully for now x not include BN
# print('no decay:{}'.format(parameter_name))
no_decay_params.append(x)
elif parameter_name.endswith('.beta'):
# bn weight bias not using weight decay, be carefully for now x not include BN
# print('no decay:{}'.format(parameter_name))
no_decay_params.append(x)
else:
decay_params.append(x)

@ -40,7 +40,7 @@ Dataset used: [imagenet](http://www.image-net.org/)
- Hardware(GPU)
- Prepare hardware environment with GPU processor.
- Framework
- [MindSpore](http://10.90.67.50/mindspore/archive/20200506/OpenSource/me_vm_x86/)
- [MindSpore](https://www.mindspore.cn/install/en)
- For more information, please check the resources below:
- [MindSpore tutorials](https://www.mindspore.cn/tutorial/zh-CN/master/index.html)
- [MindSpore API](https://www.mindspore.cn/api/zh-CN/master/index.html)

@ -66,7 +66,6 @@ def create_dataset(dataset_path, do_train, rank, group_size, repeat_num=1):
trans += [
toBGR(),
C.Rescale(1.0 / 255.0, 0.0),
# C.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]),
C.HWC2CHW(),
C2.TypeCast(mstype.float32)
]

@ -79,7 +79,6 @@ class ShuffleV2Block(nn.Cell):
def channel_shuffle(self, x):
batchsize, num_channels, height, width = P.Shape()(x)
##assert (num_channels % 4 == 0)
x = P.Reshape()(x, (batchsize * num_channels // 2, 2, height * width,))
x = P.Transpose()(x, (1, 0, 2,))
x = P.Reshape()(x, (2, -1, num_channels // 2, height, width,))

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save