#10 main

Merged
jtc merged 5 commits from lsyzz/mindcv3:main into main 1 year ago
  1. +1
    -1
      configs/edgenext/edgenext_small_ascend.yaml
  2. +77
    -0
      configs/edgenext/edgenext_small_bn_hs_ascend.yaml
  3. +6
    -6
      configs/edgenext/edgenext_x_small_ascend.yaml
  4. +5
    -5
      configs/edgenext/edgenext_xx_small_ascend.yaml
  5. BIN
      edgenext_small_best.ckpt
  6. +1
    -1
      mindcv/models/edgenext.py
  7. +3
    -0
      transfer.py

+ 1
- 1
configs/edgenext/edgenext_small_ascend.yaml View File

@@ -51,7 +51,7 @@ ckpt_path: ''
keep_checkpoint_max: 10
val_interval: 2
ckpt_save_dir: './ckpt'
epoch_size: 400
epoch_size: 350
dataset_sink_mode: True
amp_level: 'O3'
drop_path_rate: 0.1


+ 77
- 0
configs/edgenext/edgenext_small_bn_hs_ascend.yaml View File

@@ -0,0 +1,77 @@
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================

# system config
mode: 0
distribute: True
num_parallel_workers: 8
val_while_train: True

# dataset config
dataset: 'imagenet'
data_dir: ''
shuffle: True
dataset_download: False
batch_size: 256
drop_remainder: True
val_split: val

# Augmentation config
image_resize: 256
scale: [0.08, 1.0]
ratio: [0.75, 1.333]
hflip: 0.5
interpolation: 'bicubic'
crop_pct: 0.875
color_jitter: 0.4
re_prob: 0.0
cutmix: 1.0
cutmix_prob: 0.0
auto_augment: 'randaug-m9-mstd0.5-inc1'
use_ema: True
ema_decay: 0.9995

# model config
model: 'edgenext_small_bn_hs'
num_classes: 1000
pretrained: False
ckpt_path: ''
keep_checkpoint_max: 10
val_interval: 2
ckpt_save_dir: './ckpt'
epoch_size: 350
dataset_sink_mode: True
amp_level: 'O3'
drop_path_rate: 0.1

# loss config
loss: 'CE'
label_smoothing: 0.1

# lr scheduler config
scheduler: 'cosine_decay'
min_lr: 1e-6
lr: 4e-3
warmup_epochs: 20
decay_rate: 0.1
decay_epochs: 330

# optimizer config
opt: 'adamw'
filter_bias_and_bn: True
momentum: 0.9
weight_decay: 0.05
loss_scale: 1024
use_nesterov: False

+ 6
- 6
configs/edgenext/edgenext_x_small_ascend.yaml View File

@@ -33,25 +33,25 @@ image_resize: 256
scale: [0.08, 1.0]
ratio: [0.75, 1.333]
hflip: 0.5
interpolation: 'bilinear'
interpolation: 'bicubic'
crop_pct: 0.875
color_jitter: 0.4
re_prob: 0.0
cutmix: 0.875
cutmix: 1.0
cutmix_prob: 0.0
auto_augment: 'randaug-m9-mstd0.5-inc1'
use_ema: True
ema_decay: 0.9995

# model config
model: 'edgenext_small'
model: 'edgenext_x_small'
num_classes: 1000
pretrained: False
ckpt_path: ''
keep_checkpoint_max: 10
val_interval: 2
ckpt_save_dir: './ckpt'
epoch_size: 400
epoch_size: 350
dataset_sink_mode: True
amp_level: 'O3'
drop_path_rate: 0.1
@@ -63,10 +63,10 @@ label_smoothing: 0.1
# lr scheduler config
scheduler: 'cosine_decay'
min_lr: 1e-6
lr: 4.5e-3
lr: 4e-3
warmup_epochs: 20
decay_rate: 0.1
decay_epochs: 380
decay_epochs: 330

# optimizer config
opt: 'adamw'


+ 5
- 5
configs/edgenext/edgenext_xx_small_ascend.yaml View File

@@ -33,25 +33,25 @@ image_resize: 256
scale: [0.08, 1.0]
ratio: [0.75, 1.333]
hflip: 0.5
interpolation: 'bilinear'
interpolation: 'bicubic'
crop_pct: 0.875
color_jitter: 0.4
re_prob: 0.0
cutmix: 0.875
cutmix: 1.0
cutmix_prob: 0.0
auto_augment: 'randaug-m9-mstd0.5-inc1'
use_ema: True
ema_decay: 0.9995

# model config
model: 'edgenext_small_bn_hs'
model: 'edgenext_xx_small'
num_classes: 1000
pretrained: False
ckpt_path: ''
keep_checkpoint_max: 10
val_interval: 2
ckpt_save_dir: './ckpt'
epoch_size: 300
epoch_size: 350
dataset_sink_mode: True
amp_level: 'O3'
drop_path_rate: 0.1
@@ -66,7 +66,7 @@ min_lr: 1e-6
lr: 4e-3
warmup_epochs: 20
decay_rate: 0.1
decay_epochs: 380
decay_epochs: 330

# optimizer config
opt: 'adamw'


BIN
edgenext_small_best.ckpt View File


+ 1
- 1
mindcv/models/edgenext.py View File

@@ -472,7 +472,7 @@ class EdgeNeXt(nn.Cell):
def forward_features(self, x):
x = self.downsample_layers[0](x)
x = self.stages[0](x)
if self.pos_embd:
if self.pos_embd is not None:
B, C, H, W = x.shape
x = x + self.pos_embd(B, H, W)
for i in range(1, 4):


+ 3
- 0
transfer.py View File

@@ -0,0 +1,3 @@
x = 3
if x is not None:
print(1)

Loading…
Cancel
Save