mirror of
https://github.com/open-mmlab/mmpretrain.git
synced 2025-06-03 14:59:18 +08:00
* 网络搭建完成、能正常推理 * 网络搭建完成、能正常推理 * 网络搭建完成、能正常推理 * 添加了模型转换未验证,配置文件 但有无法运行 * 模型转换、结构验证完成,可以推理出正确答案 * 推理精度与原论文一致 已完成转化 * 三个方法改为class 暂存 * 完成推理精度对齐 误差0.04 * 暂时使用的levit2mmcls * 训练跑通,训练相关参数未对齐 * '训练相关参数对齐'参数' * '修复训练时验证导致模型结构改变无法复原问题' * '修复训练时验证导致模型结构改变无法复原问题' * '添加mixup和labelsmooth' * '配置文件补齐' * 添加模型转换 * 添加meta文件 * 添加meta文件 * 删除demo.py测试文件 * 添加模型README文件 * docs文件回滚 * model-index删除末行空格 * 更新模型metafile * 更新metafile * 更新metafile * 更新README和metafile * 更新模型README * 更新模型metafile * Delete the model class and get_LeViT_model methods in the mmcls.models.backone.levit file * Change the class name to Google Code Style * use arch to provide default architectures * use nn.Conv2d * mmcv.cnn.fuse_conv_bn * modify some details * remove down_ops from the architectures. * remove init_weight function * Modify ambiguous variable names * Change the drop_path in config to drop_path_rate * Add unit test * remove train function * add unit test * modify nn.norm1d to build_norm_layer * update metafile and readme * Update configs and LeViT implementations. * Update README. * Add docstring and update unit tests. * Revert irrelative modification. * Fix unit tests * minor fix Co-authored-by: mzr1996 <mzr1996@163.com>
27 lines
668 B
Python
27 lines
668 B
Python
# model settings
|
|
model = dict(
|
|
type='ImageClassifier',
|
|
backbone=dict(
|
|
type='LeViT',
|
|
arch='256',
|
|
img_size=224,
|
|
patch_size=16,
|
|
drop_path_rate=0,
|
|
attn_ratio=2,
|
|
mlp_ratio=2,
|
|
out_indices=(2, )),
|
|
neck=dict(type='GlobalAveragePooling'),
|
|
head=dict(
|
|
type='LeViTClsHead',
|
|
num_classes=1000,
|
|
in_channels=512,
|
|
distillation=True,
|
|
loss=dict(
|
|
type='LabelSmoothLoss', label_smooth_val=0.1, loss_weight=1.0),
|
|
topk=(1, 5),
|
|
),
|
|
train_cfg=dict(augments=[
|
|
dict(type='Mixup', alpha=0.8),
|
|
dict(type='CutMix', alpha=1.0),
|
|
]))
|