更新日志
2024 年 8 月 8 日
- 添加 RDNet (‘DenseNets Reloaded’, https://arxiv.org/abs/2403.19588),感谢 Donghyun Kim
2024 年 7 月 28 日
- 添加
mobilenet_edgetpu_v2_m
权重,使用基于ra4
mnv4-small 的配方。在 224 尺寸下 top-1 准确率为 80.1%,在 256 尺寸下为 80.7%。 - 发布 1.0.8 版本
2024 年 7 月 26 日
- 更多 MobileNet-v4 权重,ImageNet-12k 预训练与微调,以及抗锯齿 ConvLarge 模型
模型 | Top1 | Top1 错误率 | Top5 | Top5 错误率 | 参数量 | 图像尺寸 |
---|---|---|---|---|---|---|
mobilenetv4_conv_aa_large.e230_r448_in12k_ft_in1k | 84.99 | 15.01 | 97.294 | 2.706 | 32.59 | 544 |
mobilenetv4_conv_aa_large.e230_r384_in12k_ft_in1k | 84.772 | 15.228 | 97.344 | 2.656 | 32.59 | 480 |
mobilenetv4_conv_aa_large.e230_r448_in12k_ft_in1k | 84.64 | 15.36 | 97.114 | 2.886 | 32.59 | 448 |
mobilenetv4_conv_aa_large.e230_r384_in12k_ft_in1k | 84.314 | 15.686 | 97.102 | 2.898 | 32.59 | 384 |
mobilenetv4_conv_aa_large.e600_r384_in1k | 83.824 | 16.176 | 96.734 | 3.266 | 32.59 | 480 |
mobilenetv4_conv_aa_large.e600_r384_in1k | 83.244 | 16.756 | 96.392 | 3.608 | 32.59 | 384 |
mobilenetv4_hybrid_medium.e200_r256_in12k_ft_in1k | 82.99 | 17.01 | 96.67 | 3.33 | 11.07 | 320 |
mobilenetv4_hybrid_medium.e200_r256_in12k_ft_in1k | 82.364 | 17.636 | 96.256 | 3.744 | 11.07 | 256 |
- 令人印象深刻的 MobileNet-V1 和 EfficientNet-B0 基线挑战 (https://huggingface.co/blog/rwightman/mobilenet-baselines)
模型 | Top1 | Top1 错误率 | Top5 | Top5 错误率 | 参数量 | 图像尺寸 |
---|---|---|---|---|---|---|
efficientnet_b0.ra4_e3600_r224_in1k | 79.364 | 20.636 | 94.754 | 5.246 | 5.29 | 256 |
efficientnet_b0.ra4_e3600_r224_in1k | 78.584 | 21.416 | 94.338 | 5.662 | 5.29 | 224 |
mobilenetv1_100h.ra4_e3600_r224_in1k | 76.596 | 23.404 | 93.272 | 6.728 | 5.28 | 256 |
mobilenetv1_100.ra4_e3600_r224_in1k | 76.094 | 23.906 | 93.004 | 6.996 | 4.23 | 256 |
mobilenetv1_100h.ra4_e3600_r224_in1k | 75.662 | 24.338 | 92.504 | 7.496 | 5.28 | 224 |
mobilenetv1_100.ra4_e3600_r224_in1k | 75.382 | 24.618 | 92.312 | 7.688 | 4.23 | 224 |
- 原型
set_input_size()
已添加到 vit 和 swin v1/v2 模型中,以便在模型创建后更改图像尺寸、补丁大小、窗口大小。 - 改进了 swin 中对不同尺寸处理的支持,除了
set_input_size
之外,__init__
中还添加了always_partition
和strict_img_size
参数,以允许更灵活的输入尺寸约束 - 修复了中间 ‘Getter’ 特征包装器的索引信息顺序错误,检查了相同情况下的越界索引。
- 添加了几个小于 0.5M 参数的
tiny
模型用于测试,这些模型实际上是在 ImageNet-1k 上训练的
模型 | Top1 | Top1 错误率 | Top5 | Top5 错误率 | 参数量 | 图像尺寸 | 裁剪比例 |
---|---|---|---|---|---|---|---|
test_efficientnet.r160_in1k | 47.156 | 52.844 | 71.726 | 28.274 | 0.36 | 192 | 1.0 |
test_byobnet.r160_in1k | 46.698 | 53.302 | 71.674 | 28.326 | 0.46 | 192 | 1.0 |
test_efficientnet.r160_in1k | 46.426 | 53.574 | 70.928 | 29.072 | 0.36 | 160 | 0.875 |
test_byobnet.r160_in1k | 45.378 | 54.622 | 70.572 | 29.428 | 0.46 | 160 | 0.875 |
test_vit.r160_in1k | 42.0 | 58.0 | 68.664 | 31.336 | 0.37 | 192 | 1.0 |
test_vit.r160_in1k | 40.822 | 59.178 | 67.212 | 32.788 | 0.37 | 160 | 0.875 |
- 修复了 vit reg token 初始化,感谢 Promisery
- 其他杂项修复
2024 年 6 月 24 日
- 更多 3 个 MobileNetV4 混合权重,使用不同的 MQA 权重初始化方案
模型 | Top1 | Top1 错误率 | Top5 | Top5 错误率 | 参数量 | 图像尺寸 |
---|---|---|---|---|---|---|
mobilenetv4_hybrid_large.ix_e600_r384_in1k | 84.356 | 15.644 | 96.892 | 3.108 | 37.76 | 448 |
mobilenetv4_hybrid_large.ix_e600_r384_in1k | 83.990 | 16.010 | 96.702 | 3.298 | 37.76 | 384 |
mobilenetv4_hybrid_medium.ix_e550_r384_in1k | 83.394 | 16.606 | 96.760 | 3.240 | 11.07 | 448 |
mobilenetv4_hybrid_medium.ix_e550_r384_in1k | 82.968 | 17.032 | 96.474 | 3.526 | 11.07 | 384 |
mobilenetv4_hybrid_medium.ix_e550_r256_in1k | 82.492 | 17.508 | 96.278 | 3.722 | 11.07 | 320 |
mobilenetv4_hybrid_medium.ix_e550_r256_in1k | 81.446 | 18.554 | 95.704 | 4.296 | 11.07 | 256 |
- 在 DaViT 模型中加载 florence2 权重
2024 年 6 月 12 日
- 添加了 MobileNetV4 模型和 timm 训练权重的初始集合
模型 | Top1 | Top1 错误率 | Top5 | Top5 错误率 | 参数量 | 图像尺寸 |
---|---|---|---|---|---|---|
mobilenetv4_hybrid_large.e600_r384_in1k | 84.266 | 15.734 | 96.936 | 3.064 | 37.76 | 448 |
mobilenetv4_hybrid_large.e600_r384_in1k | 83.800 | 16.200 | 96.770 | 3.230 | 37.76 | 384 |
mobilenetv4_conv_large.e600_r384_in1k | 83.392 | 16.608 | 96.622 | 3.378 | 32.59 | 448 |
mobilenetv4_conv_large.e600_r384_in1k | 82.952 | 17.048 | 96.266 | 3.734 | 32.59 | 384 |
mobilenetv4_conv_large.e500_r256_in1k | 82.674 | 17.326 | 96.31 | 3.69 | 32.59 | 320 |
mobilenetv4_conv_large.e500_r256_in1k | 81.862 | 18.138 | 95.69 | 4.31 | 32.59 | 256 |
mobilenetv4_hybrid_medium.e500_r224_in1k | 81.276 | 18.724 | 95.742 | 4.258 | 11.07 | 256 |
mobilenetv4_conv_medium.e500_r256_in1k | 80.858 | 19.142 | 95.768 | 4.232 | 9.72 | 320 |
mobilenetv4_hybrid_medium.e500_r224_in1k | 80.442 | 19.558 | 95.38 | 4.62 | 11.07 | 224 |
mobilenetv4_conv_blur_medium.e500_r224_in1k | 80.142 | 19.858 | 95.298 | 4.702 | 9.72 | 256 |
mobilenetv4_conv_medium.e500_r256_in1k | 79.928 | 20.072 | 95.184 | 4.816 | 9.72 | 256 |
mobilenetv4_conv_medium.e500_r224_in1k | 79.808 | 20.192 | 95.186 | 4.814 | 9.72 | 256 |
mobilenetv4_conv_blur_medium.e500_r224_in1k | 79.438 | 20.562 | 94.932 | 5.068 | 9.72 | 224 |
mobilenetv4_conv_medium.e500_r224_in1k | 79.094 | 20.906 | 94.77 | 5.23 | 9.72 | 224 |
mobilenetv4_conv_small.e2400_r224_in1k | 74.616 | 25.384 | 92.072 | 7.928 | 3.77 | 256 |
mobilenetv4_conv_small.e1200_r224_in1k | 74.292 | 25.708 | 92.116 | 7.884 | 3.77 | 256 |
mobilenetv4_conv_small.e2400_r224_in1k | 73.756 | 26.244 | 91.422 | 8.578 | 3.77 | 224 |
mobilenetv4_conv_small.e1200_r224_in1k | 73.454 | 26.546 | 91.34 | 8.66 | 3.77 | 224 |
- 添加了 Apple MobileCLIP (https://arxiv.org/pdf/2311.17049, FastViT 和 ViT-B) 图像塔模型支持和权重(OpenCLIP 支持的一部分)。
- 添加了 ViTamin (https://arxiv.org/abs/2404.02132) CLIP 图像塔模型和权重(OpenCLIP 支持的一部分)。
- 添加了 OpenAI CLIP 修改的 ResNet 图像塔建模和权重支持(通过 ByobNet)。重构 AttentionPool2d。
2024 年 5 月 14 日
- 支持将 PaliGemma jax 权重加载到带有平均池化的 SigLIP ViT 模型中。
- 从 Meta 添加 Hiera 模型 (https://github.com/facebookresearch/hiera)。
- 为 transforms 添加
normalize=
标志,返回具有原始 dytpe 的非标准化 torch.Tensor (用于chug
) - 发布 1.0.3 版本
2024 年 5 月 11 日
- 发布了 ‘Searching for Better ViT Baselines (For the GPU Poor)’ 权重和 vit 变体。探索 Tiny 和 Base 之间的模型形状。
- 添加 AttentionExtract 助手以从 timm 模型中提取注意力图。请参阅 https://github.com/huggingface/pytorch-image-models/discussions/1232#discussioncomment-9320949 中的示例
forward_intermediates()
API refined 和已添加到更多模型中,包括一些具有其他提取方法的 ConvNet。- 1047 个模型架构中的 1017 个支持
features_only=True
特征提取。剩余的 34 个架构可以支持,但基于优先级请求。 - 移除了 torch.jit.script 注释的函数,包括旧的 JIT 激活。与 dynamo 冲突,且 dynamo 在使用时表现更好。
2024 年 4 月 11 日
- 准备发布期待已久的 1.0 版本,目前情况已稳定一段时间。
- 长期缺失的重要功能,
features_only=True
支持具有扁平隐藏状态或非标准模块布局的 ViT 模型(目前涵盖'vit_*'
,'twins_*'
,'deit*'
,'beit*'
,'mvitv2*'
,'eva*'
,'samvit_*'
,'flexivit*'
) - 上述功能支持通过新的
forward_intermediates()
API 实现,该 API 可以与特征包装模块或直接使用。
model = timm.create_model('vit_base_patch16_224')
final_feat, intermediates = model.forward_intermediates(input)
output = model.forward_head(final_feat) # pooling + classifier head
print(final_feat.shape)
torch.Size([2, 197, 768])
for f in intermediates:
print(f.shape)
torch.Size([2, 768, 14, 14])
torch.Size([2, 768, 14, 14])
torch.Size([2, 768, 14, 14])
torch.Size([2, 768, 14, 14])
torch.Size([2, 768, 14, 14])
torch.Size([2, 768, 14, 14])
torch.Size([2, 768, 14, 14])
torch.Size([2, 768, 14, 14])
torch.Size([2, 768, 14, 14])
torch.Size([2, 768, 14, 14])
torch.Size([2, 768, 14, 14])
torch.Size([2, 768, 14, 14])
print(output.shape)
torch.Size([2, 1000])
model = timm.create_model('eva02_base_patch16_clip_224', pretrained=True, img_size=512, features_only=True, out_indices=(-3, -2,))
output = model(torch.randn(2, 3, 512, 512))
for o in output:
print(o.shape)
torch.Size([2, 768, 32, 32])
torch.Size([2, 768, 32, 32])
- 添加了 TinyCLIP 视觉塔权重,感谢 Thien Tran
2024 年 2 月 19 日
- 添加了 Next-ViT 模型。改编自 https://github.com/bytedance/Next-ViT
- 添加了 HGNet 和 PP-HGNetV2 模型。由 SeeFun 改编自 https://github.com/PaddlePaddle/PaddleClas
- 移除了 setup.py,迁移到 PDM 支持的基于 pyproject.toml 的构建
- 添加了更新的模型 EMA 实现,使用 _for_each 以减少开销
- 在训练脚本中支持非 GPU 设备的 device 参数
- 其他杂项修复和小幅添加
- 最低支持的 Python 版本提高到 3.8
- 发布 0.9.16 版本
2024 年 1 月 8 日
数据集和 transform 重构
- HuggingFace 流式(可迭代)数据集支持 (
--dataset hfids:org/dataset
) - Webdataset 包装器调整,以改进拆分信息获取,可以从受支持的 HF hub webdataset 自动获取拆分
- 测试了来自 HF hub 的 HF
datasets
和 webdataset 包装器流式传输,以及最近 timm ImageNet 上传到 https://huggingface.co/timm 的情况 - 使输入和目标列/字段键在数据集之间保持一致,并通过 args 传递
- 完全单色支持,当使用例如
--input-size 1 224 224
或--in-chans 1
时,在数据集中适当设置 PIL 图像转换 - 改进了几个备用裁剪和调整大小 transforms (ResizeKeepRatio, RandomCropOrPad 等),用于 PixParse 文档 AI 项目
- 将 SimCLR 风格的颜色抖动概率以及灰度和高斯模糊选项添加到增强和 args 中
- 允许在训练脚本中进行无验证集的训练 (
--val-split ''
) - 添加了
--bce-sum
(对类别维度求和) 和--bce-pos-weight
(正权重) args 用于训练,因为这些是我经常硬编码的常见 BCE 损失调整
2023 年 11 月 23 日
- 添加了 EfficientViT-Large 模型,感谢 SeeFun
- 修复了 Python 3.7 兼容性,即将放弃对其的支持
- 其他杂项修复
- 发布 0.9.12 版本
2023 年 11 月 20 日
- 通过
model_args
配置条目,为基于 Hugging Face Hub 的 timm 模型添加了显着的灵活性。model_args
将作为 kwargs 传递给模型在创建时。 - 使用最新模型更新了 imagenet 评估和测试集 csv 文件
vision_transformer.py
类型和文档清理,由 Laureηt 完成- 发布 0.9.11 版本
2023 年 11 月 3 日
- 添加了 DFN (数据过滤网络) 和 MetaCLIP ViT 权重
- 添加了 DINOv2 ‘register’ ViT 模型权重 (https://huggingface.co/papers/2309.16588, https://huggingface.co/papers/2304.07193)
- 为使用 quickgelu 的 OpenAI、DFN、MetaCLIP 权重添加 quickgelu ViT 变体(效率较低)
- 感谢 Aryan,改进了添加到 ResNet、MobileNet-v3 的类型
- ImageNet-12k 微调 (来自 LAION-2B CLIP)
convnext_xxlarge
- 发布 0.9.9 版本
2023 年 10 月 20 日
vision_transformer.py
中支持 SigLIP 图像塔权重。- 在微调和下游特征使用方面具有巨大潜力。
- 实验性 ‘register’ 支持 vit 模型,根据 Vision Transformers Need Registers
- 使用新的权重版本更新了 RepViT。感谢 wangao
- 向 Swin 模型添加补丁大小调整支持(在预训练权重加载时)
- 0.9.8 版本待发布
2023 年 9 月 1 日
- 由 SeeFun 添加了 TinyViT
- 修复 EfficientViT (MIT) 以使用 torch.autocast,使其可向后兼容 PT 1.10
- 发布 0.9.7 版本
2023 年 8 月 28 日
- 向
vision_transformer.py
,vision_transformer_hybrid.py
,deit.py
和eva.py
中的模型添加动态图像尺寸支持,且不破坏向后兼容性。- 在模型创建时向 args 添加
dynamic_img_size=True
,以允许更改网格大小(每次前向传播都插值 abs 和/或 ROPE pos embed)。 - 添加
dynamic_img_pad=True
以允许图像尺寸不能被补丁大小整除(每次前向传播都将右下角填充到补丁大小)。 - 启用任一动态模式都会破坏 FX 跟踪,除非将 PatchEmbed 模块添加为叶子模块。
- 通过在创建时传递不同的
img_size
(插值预训练嵌入权重一次)来调整位置嵌入大小的现有方法仍然有效。 - 通过在创建时更改
patch_size
(调整预训练 patch_embed 权重一次)的现有方法仍然有效。 - 示例验证 cmd
python validate.py /imagenet --model vit_base_patch16_224 --amp --amp-dtype bfloat16 --img-size 255 --crop-pct 1.0 --model-kwargs dynamic_img_size=True dyamic_img_pad=True
- 在模型创建时向 args 添加
2023 年 8 月 25 日
- 自上次发布以来,许多新模型
- FastViT - https://arxiv.org/abs/2303.14189
- MobileOne - https://arxiv.org/abs/2206.04040
- InceptionNeXt - https://arxiv.org/abs/2303.16900
- RepGhostNet - https://arxiv.org/abs/2211.06088 (感谢 https://github.com/ChengpengChen)
- GhostNetV2 - https://arxiv.org/abs/2211.12905 (感谢 https://github.com/yehuitang)
- EfficientViT (MSRA) - https://arxiv.org/abs/2305.07027 (感谢 https://github.com/seefun)
- EfficientViT (MIT) - https://arxiv.org/abs/2205.14756 (感谢 https://github.com/seefun)
- 向
benchmark.py
,onnx_export.py
和validate.py
添加--reparam
参数,以触发具有reparameterize()
,switch_to_deploy()
或fuse()
中任一方法的模型的层重新参数化/融合- 包括 FastViT、MobileOne、RepGhostNet、EfficientViT (MSRA)、RepViT、RepVGG 和 LeViT
- 准备 0.9.6 ‘返校’ 版本发布
2023 年 8 月 11 日
- Swin、MaxViT、CoAtNet 和 BEiT 模型支持在创建时调整图像/窗口大小,并能自适应预训练权重
- 用于测试非方形调整大小的示例验证命令:
python validate.py /imagenet --model swin_base_patch4_window7_224.ms_in2k_ft_in1k --amp --amp-dtype bfloat16 --input-size 3 256 320 --model-kwargs window_size=8,10 img_size=256,320
8月3日,2023年
- 为 HRNet w18_small 和 w18_small_v2 添加 GluonCV 权重。由 SeeFun 转换。
- 修复
selecsls*
模型命名回归问题 - ViT/EVA 的 Patch 和位置嵌入适用于加载时的 bfloat16/float16 权重(或用于即时调整大小的激活值)
- v0.9.5 版本发布准备
7月27日,2023年
- 添加了 timm 训练的
seresnextaa201d_32x8d.sw_in12k_ft_in1k_384
权重(以及.sw_in12k
预训练),在 ImageNet-1k 上达到了 87.3% 的 top-1 准确率,这是我所知的 ImageNet ResNet 系列模型中的最佳模型。 - RepViT 模型和权重 (https://arxiv.org/abs/2307.09283) 由 wangao 添加
- I-JEPA ViT 特征权重(无分类器)由 SeeFun 添加
- SAM-ViT (segment anything) 特征权重(无分类器)由 SeeFun 添加
- 为 EfficientNet 添加对替代特征提取方法和负索引的支持
- 添加 NAdamW 优化器
- 其他修复
5月11日,2023年
timm
0.9 发布,从 0.8.xdev 版本过渡
5月10日,2023年
- Hugging Face Hub 下载现已成为默认设置,https://huggingface.co/timm 上有 1132 个模型,
timm
中有 1163 个权重 - 感谢 Leng Yue,添加了 DINOv2 vit 特征骨干网络权重
- 添加了 FB MAE vit 特征骨干网络权重
- 添加了 OpenCLIP DataComp-XL L/14 特征骨干网络权重
- MetaFormer (poolformer-v2、caformer、convformer、更新后的 poolformer (v1)) 及其权重由 Fredo Guan 添加
- 在 vit/deit 模型上添加了实验性的
get_intermediate_layers
函数,用于获取隐藏状态(灵感来自 DINO 实现)。这仍在开发中,可能会有重大更改……欢迎提供反馈。 - 如果
pretrained=True
且不存在权重,模型创建将抛出错误(而不是继续随机初始化) - 修复了 inception / nasnet TF 源权重在原始分类器中具有 1001 个类别时的回归问题
- bitsandbytes (https://github.com/TimDettmers/bitsandbytes) 优化器已添加到工厂,使用
bnb
前缀,例如bnbadam8bit
- 其他清理和修复
- 切换到 0.9 版本并将
timm
从预发布状态中移除之前的最终测试
4月27日,2023年
- 97% 的
timm
模型已上传到 HF Hub,几乎所有模型都已更新以支持多权重预训练配置 - 由于添加了多权重,对另一批模型进行了少量清理和重构。增加了对 fused_attn (F.sdpa) 和 features_only 的支持,并修复了 torchscript。
4月21日,2023年
- 梯度累积支持已添加到训练脚本并经过测试 (
--grad-accum-steps
),感谢 Taeksang Kim - HF Hub 上提供了更多权重(cspnet、cait、volo、xcit、tresnet、hardcorenas、densenet、dpn、vovnet、xception_aligned)
- 在 train.py 中添加了
--head-init-scale
和--head-init-bias
,用于缩放分类器头部并为微调设置固定偏差 - 移除了所有 InplaceABN (
inplace_abn
) 的使用,在 tresnet 中用标准 BatchNorm 替换了使用(并相应地修改了权重)。
4月12日,2023年
- 添加了 ONNX 导出脚本、验证脚本以及我长期以来一直在使用的辅助工具。调整了“same”填充,以便在使用最新的 ONNX + pytorch 时获得更好的导出效果。
- 重构了 vit 和类似 vit 的模型的 dropout 参数,将 drop_rate 分离为
drop_rate
(分类器 dropout)、proj_drop_rate
(块 mlp / 输出投影)、pos_drop_rate
(位置嵌入 dropout)、attn_drop_rate
(注意力 dropout)。还为 vit 和 eva 模型添加了 patch dropout (FLIP)。 - 为更多 vit 模型添加了 fused F.scaled_dot_product_attention 支持,添加了环境变量 (TIMM_FUSED_ATTN) 以进行控制,并添加了配置接口以启用/禁用
- 添加了 EVA-CLIP 骨干网络及其图像塔权重,一直到 40 亿参数的“enormous”模型,以及遗漏的 336x336 OpenAI ViT 模式。
4月5日,2023年
- 所有 ResNet 模型都已推送到 Hugging Face Hub,并支持多权重
- 添加了所有过去的
timm
训练权重,并使用基于 recipe 的标签进行区分 - 所有 ResNet strikes back A1/A2/A3 (seed 0) 和 R50 示例 B/C1/C2/D 权重均可用
- 将 torchvision v2 recipe 权重添加到现有的 torchvision 原始权重中
- 请参阅 https://huggingface.co/timm/seresnextaa101d_32x8d.sw_in12k_ft_in1k_288#model-comparison 中的比较表
- 添加了所有过去的
- 新的 ImageNet-12k + ImageNet-1k 微调可用于一些抗锯齿 ResNet 模型
resnetaa50d.sw_in12k_ft_in1k
- 81.7 @ 224, 82.6 @ 288resnetaa101d.sw_in12k_ft_in1k
- 83.5 @ 224, 84.1 @ 288seresnextaa101d_32x8d.sw_in12k_ft_in1k
- 86.0 @ 224, 86.5 @ 288seresnextaa101d_32x8d.sw_in12k_ft_in1k_288
- 86.5 @ 288, 86.7 @ 320
3月31日,2023年
- 为 convnext-base/large CLIP 模型添加了首个 ConvNext-XXLarge CLIP -> IN-1k 微调和 IN-12k 中间微调。
模型 | Top1 | Top5 | 图像尺寸 | 参数量 | gmacs | macts |
---|---|---|---|---|---|---|
convnext_xxlarge.clip_laion2b_soup_ft_in1k | 88.612 | 98.704 | 256 | 846.47 | 198.09 | 124.45 |
convnext_large_mlp.clip_laion2b_soup_ft_in12k_in1k_384 | 88.312 | 98.578 | 384 | 200.13 | 101.11 | 126.74 |
convnext_large_mlp.clip_laion2b_soup_ft_in12k_in1k_320 | 87.968 | 98.47 | 320 | 200.13 | 70.21 | 88.02 |
convnext_base.clip_laion2b_augreg_ft_in12k_in1k_384 | 87.138 | 98.212 | 384 | 88.59 | 45.21 | 84.49 |
convnext_base.clip_laion2b_augreg_ft_in12k_in1k | 86.344 | 97.97 | 256 | 88.59 | 20.09 | 37.55 |
- 添加了 EVA-02 MIM 预训练和微调权重,推送到 HF hub 并更新所有 EVA 模型的模型卡。首个 top-1 准确率超过 90% 的模型(top-5 准确率达到 99%)!请查看 https://github.com/baaivision/EVA 上的原始代码和权重,以了解更多关于他们将 MIM、CLIP 与多种模型、数据集和训练 recipe 调整相结合的工作细节。
模型 | Top1 | Top5 | 参数量 | 图像尺寸 |
---|---|---|---|---|
eva02_large_patch14_448.mim_m38m_ft_in22k_in1k | 90.054 | 99.042 | 305.08 | 448 |
eva02_large_patch14_448.mim_in22k_ft_in22k_in1k | 89.946 | 99.01 | 305.08 | 448 |
eva_giant_patch14_560.m30m_ft_in22k_in1k | 89.792 | 98.992 | 1014.45 | 560 |
eva02_large_patch14_448.mim_in22k_ft_in1k | 89.626 | 98.954 | 305.08 | 448 |
eva02_large_patch14_448.mim_m38m_ft_in1k | 89.57 | 98.918 | 305.08 | 448 |
eva_giant_patch14_336.m30m_ft_in22k_in1k | 89.56 | 98.956 | 1013.01 | 336 |
eva_giant_patch14_336.clip_ft_in1k | 89.466 | 98.82 | 1013.01 | 336 |
eva_large_patch14_336.in22k_ft_in22k_in1k | 89.214 | 98.854 | 304.53 | 336 |
eva_giant_patch14_224.clip_ft_in1k | 88.882 | 98.678 | 1012.56 | 224 |
eva02_base_patch14_448.mim_in22k_ft_in22k_in1k | 88.692 | 98.722 | 87.12 | 448 |
eva_large_patch14_336.in22k_ft_in1k | 88.652 | 98.722 | 304.53 | 336 |
eva_large_patch14_196.in22k_ft_in22k_in1k | 88.592 | 98.656 | 304.14 | 196 |
eva02_base_patch14_448.mim_in22k_ft_in1k | 88.23 | 98.564 | 87.12 | 448 |
eva_large_patch14_196.in22k_ft_in1k | 87.934 | 98.504 | 304.14 | 196 |
eva02_small_patch14_336.mim_in22k_ft_in1k | 85.74 | 97.614 | 22.13 | 336 |
eva02_tiny_patch14_336.mim_in22k_ft_in1k | 80.658 | 95.524 | 5.76 | 336 |
- DeiT 和基于 MLP-Mixer 的模型的多权重和 HF hub 支持
3月22日,2023年
- 更多权重已推送到 HF hub,并支持多权重,包括:
regnet.py
、rexnet.py
、byobnet.py
、resnetv2.py
、swin_transformer.py
、swin_transformer_v2.py
、swin_transformer_v2_cr.py
- Swin Transformer 模型支持特征提取(
swinv2_cr_*
的 NCHW 特征图,以及所有其他模型的 NHWC 特征图)和空间嵌入输出。 - FocalNet (来自 https://github.com/microsoft/FocalNet) 模型和权重已添加,并进行了重大重构、特征提取,且没有固定的分辨率/尺寸约束
- RegNet 权重已增加,通过 HF hub 推送了 SWAG、SEER 和 torchvision v2 权重。SEER 在模型大小的性能方面相当差,但可能仍然有用。
- 更多 ImageNet-12k 预训练和 1k 微调的
timm
权重rexnetr_200.sw_in12k_ft_in1k
- 82.6 @ 224, 83.2 @ 288rexnetr_300.sw_in12k_ft_in1k
- 84.0 @ 224, 84.5 @ 288regnety_120.sw_in12k_ft_in1k
- 85.0 @ 224, 85.4 @ 288regnety_160.lion_in12k_ft_in1k
- 85.6 @ 224, 86.0 @ 288regnety_160.sw_in12k_ft_in1k
- 85.6 @ 224, 86.0 @ 288(与 SWAG PT + 1k FT 相比,性能相同,但分辨率低得多,远超 SEER FT)
- 添加了模型名称弃用 + 重新映射功能(是将 0.8.x 从预发布状态中移除的一个里程碑)。正在添加映射……
- 少量错误修复和改进。
2月26日,2023年
- 添加了 ConvNeXt-XXLarge CLIP 预训练图像塔权重,用于微调和特征提取(微调待定)——请参阅 模型卡
- 将
convnext_xxlarge
默认 LayerNorm eps 更新为 1e-5(对于 CLIP 权重,提高了稳定性) - 0.8.15dev0
2月20日,2023年
- 添加了 320x320
convnext_large_mlp.clip_laion2b_ft_320
和convnext_lage_mlp.clip_laion2b_ft_soup_320
CLIP 图像塔权重,用于特征提取和微调 - 0.8.13dev0 pypi 版本发布,包含最新更改,并迁移到 huggingface org
2月16日,2023年
- 添加了
safetensor
检查点支持 - 添加了来自 ‘Scaling Vision Transformers to 22 B. Params’ (https://arxiv.org/abs/2302.05442) 的想法——qk 归一化、RmsNorm、并行块
- 为
vit_*
、vit_relpos_*
、coatnet
/maxxvit
添加了 F.scaled_dot_product_attention 支持(仅限 PyTorch 2.0) (首先开始) - 添加了 Lion 优化器(带有 multi-tensor 选项)(https://arxiv.org/abs/2302.06675)
- 梯度检查点机制适用于
features_only=True
2月7日,2023年
- 新的推理基准测试数字已添加到 results 文件夹中。
- 添加了 convnext LAION CLIP 训练的权重和 in1k 微调的初始集
convnext_base.clip_laion2b_augreg_ft_in1k
- 86.2% @ 256x256convnext_base.clip_laiona_augreg_ft_in1k_384
- 86.5% @ 384x384convnext_large_mlp.clip_laion2b_augreg_ft_in1k
- 87.3% @ 256x256convnext_large_mlp.clip_laion2b_augreg_ft_in1k_384
- 87.9% @ 384x384
- 添加了 DaViT 模型。支持
features_only=True
。由 Fredo 从 https://github.com/dingmyu/davit 改编。 - 在 MaxViT、ConvNeXt、DaViT 中使用通用的 NormMlpClassifierHead
- 添加了 EfficientFormer-V2 模型,更新了 EfficientFormer,并重构了 LeViT(密切相关的架构)。权重在 HF hub 上。
- 新的 EfficientFormer-V2 架构,从原始架构 (https://github.com/snap-research/EfficientFormer) 进行了重大重构。支持
features_only=True
。 - 对 EfficientFormer 进行了少量更新。
- 将 LeViT 模型重构为 stages,为新的
conv
变体添加了features_only=True
支持,需要重新映射权重。
- 新的 EfficientFormer-V2 架构,从原始架构 (https://github.com/snap-research/EfficientFormer) 进行了重大重构。支持
- 将 ImageNet 元数据(synsets、indices)从
/results
移动到timm/data/_info
。 - 添加了 ImageNetInfo / DatasetInfo 类,以便为
timm
中各种 ImageNet 分类器布局提供标签- 更新了
inference.py
以供使用,尝试:python inference.py /folder/to/images --model convnext_small.in12k --label-type detail --topk 5
- 更新了
- 准备发布 0.8.10 pypi 预发布版本(最终测试)。
1月20日,2023年
在 384x384 分辨率下添加了两个 convnext 12k -> 1k 微调
convnext_tiny.in12k_ft_in1k_384
- 85.1 @ 384convnext_small.in12k_ft_in1k_384
- 86.2 @ 384
将所有 MaxxViT 权重推送到 HF hub,并为
rw
基础 MaxViT 和 CoAtNet 1/2 模型添加新的 ImageNet-12k -> 1k 微调
模型 | Top1 | Top5 | 样本/秒 | 参数量 (M) | GMAC | Act (M) |
---|---|---|---|---|---|---|
maxvit_xlarge_tf_512.in21k_ft_in1k | 88.53 | 98.64 | 21.76 | 475.77 | 534.14 | 1413.22 |
maxvit_xlarge_tf_384.in21k_ft_in1k | 88.32 | 98.54 | 42.53 | 475.32 | 292.78 | 668.76 |
maxvit_base_tf_512.in21k_ft_in1k | 88.20 | 98.53 | 50.87 | 119.88 | 138.02 | 703.99 |
maxvit_large_tf_512.in21k_ft_in1k | 88.04 | 98.40 | 36.42 | 212.33 | 244.75 | 942.15 |
maxvit_large_tf_384.in21k_ft_in1k | 87.98 | 98.56 | 71.75 | 212.03 | 132.55 | 445.84 |
maxvit_base_tf_384.in21k_ft_in1k | 87.92 | 98.54 | 104.71 | 119.65 | 73.80 | 332.90 |
maxvit_rmlp_base_rw_384.sw_in12k_ft_in1k | 87.81 | 98.37 | 106.55 | 116.14 | 70.97 | 318.95 |
maxxvitv2_rmlp_base_rw_384.sw_in12k_ft_in1k | 87.47 | 98.37 | 149.49 | 116.09 | 72.98 | 213.74 |
coatnet_rmlp_2_rw_384.sw_in12k_ft_in1k | 87.39 | 98.31 | 160.80 | 73.88 | 47.69 | 209.43 |
maxvit_rmlp_base_rw_224.sw_in12k_ft_in1k | 86.89 | 98.02 | 375.86 | 116.14 | 23.15 | 92.64 |
maxxvitv2_rmlp_base_rw_224.sw_in12k_ft_in1k | 86.64 | 98.02 | 501.03 | 116.09 | 24.20 | 62.77 |
maxvit_base_tf_512.in1k | 86.60 | 97.92 | 50.75 | 119.88 | 138.02 | 703.99 |
coatnet_2_rw_224.sw_in12k_ft_in1k | 86.57 | 97.89 | 631.88 | 73.87 | 15.09 | 49.22 |
maxvit_large_tf_512.in1k | 86.52 | 97.88 | 36.04 | 212.33 | 244.75 | 942.15 |
coatnet_rmlp_2_rw_224.sw_in12k_ft_in1k | 86.49 | 97.90 | 620.58 | 73.88 | 15.18 | 54.78 |
maxvit_base_tf_384.in1k | 86.29 | 97.80 | 101.09 | 119.65 | 73.80 | 332.90 |
maxvit_large_tf_384.in1k | 86.23 | 97.69 | 70.56 | 212.03 | 132.55 | 445.84 |
maxvit_small_tf_512.in1k | 86.10 | 97.76 | 88.63 | 69.13 | 67.26 | 383.77 |
maxvit_tiny_tf_512.in1k | 85.67 | 97.58 | 144.25 | 31.05 | 33.49 | 257.59 |
maxvit_small_tf_384.in1k | 85.54 | 97.46 | 188.35 | 69.02 | 35.87 | 183.65 |
maxvit_tiny_tf_384.in1k | 85.11 | 97.38 | 293.46 | 30.98 | 17.53 | 123.42 |
maxvit_large_tf_224.in1k | 84.93 | 96.97 | 247.71 | 211.79 | 43.68 | 127.35 |
coatnet_rmlp_1_rw2_224.sw_in12k_ft_in1k | 84.90 | 96.96 | 1025.45 | 41.72 | 8.11 | 40.13 |
maxvit_base_tf_224.in1k | 84.85 | 96.99 | 358.25 | 119.47 | 24.04 | 95.01 |
maxxvit_rmlp_small_rw_256.sw_in1k | 84.63 | 97.06 | 575.53 | 66.01 | 14.67 | 58.38 |
coatnet_rmlp_2_rw_224.sw_in1k | 84.61 | 96.74 | 625.81 | 73.88 | 15.18 | 54.78 |
maxvit_rmlp_small_rw_224.sw_in1k | 84.49 | 96.76 | 693.82 | 64.90 | 10.75 | 49.30 |
maxvit_small_tf_224.in1k | 84.43 | 96.83 | 647.96 | 68.93 | 11.66 | 53.17 |
maxvit_rmlp_tiny_rw_256.sw_in1k | 84.23 | 96.78 | 807.21 | 29.15 | 6.77 | 46.92 |
coatnet_1_rw_224.sw_in1k | 83.62 | 96.38 | 989.59 | 41.72 | 8.04 | 34.60 |
maxvit_tiny_rw_224.sw_in1k | 83.50 | 96.50 | 1100.53 | 29.06 | 5.11 | 33.11 |
maxvit_tiny_tf_224.in1k | 83.41 | 96.59 | 1004.94 | 30.92 | 5.60 | 35.78 |
coatnet_rmlp_1_rw_224.sw_in1k | 83.36 | 96.45 | 1093.03 | 41.69 | 7.85 | 35.47 |
maxxvitv2_nano_rw_256.sw_in1k | 83.11 | 96.33 | 1276.88 | 23.70 | 6.26 | 23.05 |
maxxvit_rmlp_nano_rw_256.sw_in1k | 83.03 | 96.34 | 1341.24 | 16.78 | 4.37 | 26.05 |
maxvit_rmlp_nano_rw_256.sw_in1k | 82.96 | 96.26 | 1283.24 | 15.50 | 4.47 | 31.92 |
maxvit_nano_rw_256.sw_in1k | 82.93 | 96.23 | 1218.17 | 15.45 | 4.46 | 30.28 |
coatnet_bn_0_rw_224.sw_in1k | 82.39 | 96.19 | 1600.14 | 27.44 | 4.67 | 22.04 |
coatnet_0_rw_224.sw_in1k | 82.39 | 95.84 | 1831.21 | 27.44 | 4.43 | 18.73 |
coatnet_rmlp_nano_rw_224.sw_in1k | 82.05 | 95.87 | 2109.09 | 15.15 | 2.62 | 20.34 |
coatnext_nano_rw_224.sw_in1k | 81.95 | 95.92 | 2525.52 | 14.70 | 2.47 | 12.80 |
coatnet_nano_rw_224.sw_in1k | 81.70 | 95.64 | 2344.52 | 15.14 | 2.41 | 15.41 |
maxvit_rmlp_pico_rw_256.sw_in1k | 80.53 | 95.21 | 1594.71 | 7.52 | 1.85 | 24.86 |
1月11日,2023年
- 更新了 ConvNeXt ImageNet-12k 预训练系列,包含两个新的微调权重(以及预 FT
.in12k
标签)convnext_nano.in12k_ft_in1k
- 82.3 @ 224, 82.9 @ 288(之前已发布)convnext_tiny.in12k_ft_in1k
- 84.2 @ 224, 84.5 @ 288convnext_small.in12k_ft_in1k
- 85.2 @ 224, 85.3 @ 288
1月6日,2023年
- 最终添加了
--model-kwargs
和--opt-kwargs
到脚本,以便从命令行将不常用的参数直接传递到模型类train.py /imagenet --model resnet50 --amp --model-kwargs output_stride=16 act_layer=silu
train.py /imagenet --model vit_base_patch16_clip_224 --img-size 240 --amp --model-kwargs img_size=240 patch_size=12
- 清理了一些流行的模型,以更好地支持参数传递/与模型配置合并,更多工作正在进行中。
1月5日,2023年
- 将 ConvNeXt-V2 模型和权重添加到现有的
convnext.py
中- 论文: ConvNeXt V2: Co-designing and Scaling ConvNets with Masked Autoencoders
- 参考实现: https://github.com/facebookresearch/ConvNeXt-V2 (注意: 权重目前为 CC-BY-NC) @dataclass
12月23日,2022年 🎄☃
- 添加了 FlexiViT 模型和权重,来自 https://github.com/google-research/big_vision(请查看论文 https://arxiv.org/abs/2212.08013)
- 注意:目前调整大小在模型创建时是静态的,即时动态/训练 patch 大小采样正在开发中 (WIP)
- 更多模型已更新为多权重,现在可以通过 HF hub 下载(convnext、efficientnet、mobilenet、vision_transformer*、beit)
- 更多模型预训练标签和调整,一些模型名称已更改(正在进行弃用翻译,目前将主分支视为 DEV 分支,稳定使用请使用 0.6.x)
- 涌现出更多 ImageNet-12k(22k 的子集)预训练模型
efficientnet_b5.in12k_ft_in1k
- 85.9 @ 448x448vit_medium_patch16_gap_384.in12k_ft_in1k
- 85.5 @ 384x384vit_medium_patch16_gap_256.in12k_ft_in1k
- 84.5 @ 256x256convnext_nano.in12k_ft_in1k
- 82.9 @ 288x288
12月8日,2022年
- 将 ‘EVA l’ 添加到
vision_transformer.py
,MAE 风格的 ViT-L/14 MIM 预训练,使用 EVA-CLIP 目标,在 ImageNet-1k 上进行 FT(对于某些模型,使用 ImageNet-22k 作为中间步骤)
模型 | Top1 | 参数量 | gmac | macts | hub |
---|---|---|---|---|---|
eva_large_patch14_336.in22k_ft_in22k_in1k | 89.2 | 304.5 | 191.1 | 270.2 | 链接 |
eva_large_patch14_336.in22k_ft_in1k | 88.7 | 304.5 | 191.1 | 270.2 | 链接 |
eva_large_patch14_196.in22k_ft_in22k_in1k | 88.6 | 304.1 | 61.6 | 63.5 | 链接 |
eva_large_patch14_196.in22k_ft_in1k | 87.9 | 304.1 | 61.6 | 63.5 | 链接 |
Dec 6, 2022
- 在
beit.py
中添加 ‘EVA g’、BEiT 风格的 ViT-g/14 模型权重,包括 MIM 预训练和 CLIP 预训练。
模型 | Top1 | 参数量 | gmac | macts | hub |
---|---|---|---|---|---|
eva_giant_patch14_560.m30m_ft_in22k_in1k | 89.8 | 1014.4 | 1906.8 | 2577.2 | 链接 |
eva_giant_patch14_336.m30m_ft_in22k_in1k | 89.6 | 1013 | 620.6 | 550.7 | 链接 |
eva_giant_patch14_336.clip_ft_in1k | 89.4 | 1013 | 620.6 | 550.7 | 链接 |
eva_giant_patch14_224.clip_ft_in1k | 89.1 | 1012.6 | 267.2 | 192.6 | 链接 |
Dec 5, 2022
- 多权重支持 (
model_arch.pretrained_tag
) 的预发布版本 (0.8.0dev0
)。使用pip install --pre timm
安装- vision_transformer、maxvit、convnext 是首批支持的三种模型实现
- 模型名称正在随之更改(之前的 _21k 等函数将会合并),仍在整理弃用处理
- 可能存在错误,但我需要反馈,所以请尝试一下
- 如果需要稳定性,请使用 0.6.x pypi 版本或从 0.6.x 分支 克隆
- 在 train/validate/inference/benchmark 中添加了对 PyTorch 2.0 compile 的支持,使用
--torchcompile
参数 - 推理脚本允许更多地控制输出,选择 k 以获取前 k 类的索引 + 概率 json、csv 或 parquet 输出
- 添加了一整套来自 LAION-2B 和原始 OpenAI CLIP 模型的微调 CLIP 图像塔权重
模型 | Top1 | 参数量 | gmac | macts | hub |
---|---|---|---|---|---|
vit_huge_patch14_clip_336.laion2b_ft_in12k_in1k | 88.6 | 632.5 | 391 | 407.5 | 链接 |
vit_large_patch14_clip_336.openai_ft_in12k_in1k | 88.3 | 304.5 | 191.1 | 270.2 | 链接 |
vit_huge_patch14_clip_224.laion2b_ft_in12k_in1k | 88.2 | 632 | 167.4 | 139.4 | 链接 |
vit_large_patch14_clip_336.laion2b_ft_in12k_in1k | 88.2 | 304.5 | 191.1 | 270.2 | 链接 |
vit_large_patch14_clip_224.openai_ft_in12k_in1k | 88.2 | 304.2 | 81.1 | 88.8 | 链接 |
vit_large_patch14_clip_224.laion2b_ft_in12k_in1k | 87.9 | 304.2 | 81.1 | 88.8 | 链接 |
vit_large_patch14_clip_224.openai_ft_in1k | 87.9 | 304.2 | 81.1 | 88.8 | 链接 |
vit_large_patch14_clip_336.laion2b_ft_in1k | 87.9 | 304.5 | 191.1 | 270.2 | 链接 |
vit_huge_patch14_clip_224.laion2b_ft_in1k | 87.6 | 632 | 167.4 | 139.4 | 链接 |
vit_large_patch14_clip_224.laion2b_ft_in1k | 87.3 | 304.2 | 81.1 | 88.8 | 链接 |
vit_base_patch16_clip_384.laion2b_ft_in12k_in1k | 87.2 | 86.9 | 55.5 | 101.6 | 链接 |
vit_base_patch16_clip_384.openai_ft_in12k_in1k | 87 | 86.9 | 55.5 | 101.6 | 链接 |
vit_base_patch16_clip_384.laion2b_ft_in1k | 86.6 | 86.9 | 55.5 | 101.6 | 链接 |
vit_base_patch16_clip_384.openai_ft_in1k | 86.2 | 86.9 | 55.5 | 101.6 | 链接 |
vit_base_patch16_clip_224.laion2b_ft_in12k_in1k | 86.2 | 86.6 | 17.6 | 23.9 | 链接 |
vit_base_patch16_clip_224.openai_ft_in12k_in1k | 85.9 | 86.6 | 17.6 | 23.9 | 链接 |
vit_base_patch32_clip_448.laion2b_ft_in12k_in1k | 85.8 | 88.3 | 17.9 | 23.9 | 链接 |
vit_base_patch16_clip_224.laion2b_ft_in1k | 85.5 | 86.6 | 17.6 | 23.9 | 链接 |
vit_base_patch32_clip_384.laion2b_ft_in12k_in1k | 85.4 | 88.3 | 13.1 | 16.5 | 链接 |
vit_base_patch16_clip_224.openai_ft_in1k | 85.3 | 86.6 | 17.6 | 23.9 | 链接 |
vit_base_patch32_clip_384.openai_ft_in12k_in1k | 85.2 | 88.3 | 13.1 | 16.5 | 链接 |
vit_base_patch32_clip_224.laion2b_ft_in12k_in1k | 83.3 | 88.2 | 4.4 | 5 | 链接 |
vit_base_patch32_clip_224.laion2b_ft_in1k | 82.6 | 88.2 | 4.4 | 5 | 链接 |
vit_base_patch32_clip_224.openai_ft_in1k | 81.9 | 88.2 | 4.4 | 5 | 链接 |
- 从官方实现 https://github.com/google-research/maxvit 移植 MaxViT Tensorflow 权重
- 对于放大的 384/512 in21k 微调权重,存在比预期更大的下降,可能缺少细节,但 21k FT 似乎对小的预处理很敏感
模型 | Top1 | 参数量 | gmac | macts | hub |
---|---|---|---|---|---|
maxvit_xlarge_tf_512.in21k_ft_in1k | 88.5 | 475.8 | 534.1 | 1413.2 | 链接 |
maxvit_xlarge_tf_384.in21k_ft_in1k | 88.3 | 475.3 | 292.8 | 668.8 | 链接 |
maxvit_base_tf_512.in21k_ft_in1k | 88.2 | 119.9 | 138 | 704 | 链接 |
maxvit_large_tf_512.in21k_ft_in1k | 88 | 212.3 | 244.8 | 942.2 | 链接 |
maxvit_large_tf_384.in21k_ft_in1k | 88 | 212 | 132.6 | 445.8 | 链接 |
maxvit_base_tf_384.in21k_ft_in1k | 87.9 | 119.6 | 73.8 | 332.9 | 链接 |
maxvit_base_tf_512.in1k | 86.6 | 119.9 | 138 | 704 | 链接 |
maxvit_large_tf_512.in1k | 86.5 | 212.3 | 244.8 | 942.2 | 链接 |
maxvit_base_tf_384.in1k | 86.3 | 119.6 | 73.8 | 332.9 | 链接 |
maxvit_large_tf_384.in1k | 86.2 | 212 | 132.6 | 445.8 | 链接 |
maxvit_small_tf_512.in1k | 86.1 | 69.1 | 67.3 | 383.8 | 链接 |
maxvit_tiny_tf_512.in1k | 85.7 | 31 | 33.5 | 257.6 | 链接 |
maxvit_small_tf_384.in1k | 85.5 | 69 | 35.9 | 183.6 | 链接 |
maxvit_tiny_tf_384.in1k | 85.1 | 31 | 17.5 | 123.4 | 链接 |
maxvit_large_tf_224.in1k | 84.9 | 211.8 | 43.7 | 127.4 | 链接 |
maxvit_base_tf_224.in1k | 84.9 | 119.5 | 24 | 95 | 链接 |
maxvit_small_tf_224.in1k | 84.4 | 68.9 | 11.7 | 53.2 | 链接 |
maxvit_tiny_tf_224.in1k | 83.4 | 30.9 | 5.6 | 35.8 | 链接 |
Oct 15, 2022
- 训练和验证脚本增强
- 非 GPU(即 CPU)设备支持
- 训练脚本的 SLURM 兼容性
- HF 数据集支持(通过 ReaderHfds)
- TFDS/WDS 数据加载改进(针对分布式使用的样本填充/包装已修复,与样本计数估计相关)
- 脚本/加载器的 in_chans !=3 支持
- Adan 优化器
- 可以通过 args 启用每步 LR 调度
- 数据集 ‘parsers’ 重命名为 ‘readers’,更具描述性
- AMP args 已更改,APEX 通过
--amp-impl apex
,bfloat16 支持通过--amp-dtype bfloat16
- 主分支切换到 0.7.x 版本,0.6x 分支用于仅添加权重的稳定版本
- master -> main 分支重命名
Oct 10, 2022
maxxvit
系列中更多权重,包括首个基于 ConvNeXt 块的coatnext
和maxxvit
实验coatnext_nano_rw_224
- 82.0 @ 224 (G) —(使用 ConvNeXt conv 块,无 BatchNorm)maxxvit_rmlp_nano_rw_256
- 83.0 @ 256, 83.7 @ 320 (G) (使用 ConvNeXt conv 块,无 BN)maxvit_rmlp_small_rw_224
- 84.5 @ 224, 85.1 @ 320 (G)maxxvit_rmlp_small_rw_256
- 84.6 @ 256, 84.9 @ 288 (G) — 可能可以训练得更好,hparams 需要调整(使用 ConvNeXt 块,无 BN)coatnet_rmlp_2_rw_224
- 84.6 @ 224, 85 @ 320 (T)- 注意:官方 MaxVit 权重 (in1k) 已在 https://github.com/google-research/maxvit 上发布 — 由于我的实现是独立于他们的实现创建的,并且有一些小的差异 + 整个 TF 相同填充的乐趣,因此需要额外的工作来移植和适配。
Sept 23, 2022
- LAION-2B CLIP 图像塔支持作为微调或特征的预训练骨干网络(无分类器)
- vit_base_patch32_224_clip_laion2b
- vit_large_patch14_224_clip_laion2b
- vit_huge_patch14_224_clip_laion2b
- vit_giant_patch14_224_clip_laion2b
Sept 7, 2022
- Hugging Face
timm
文档 主页现已存在,未来请在此处查找更多内容 - 从 https://github.com/microsoft/unilm/tree/master/beit2 添加基础模型和大型 224x224 模型的 BEiT-v2 权重
- 在
maxxvit
系列中添加更多权重,包括pico
(750 万参数,1.9 GMACs)、两个tiny
变体maxvit_rmlp_pico_rw_256
- 80.5 @ 256, 81.3 @ 320 (T)maxvit_tiny_rw_224
- 83.5 @ 224 (G)maxvit_rmlp_tiny_rw_256
- 84.2 @ 256, 84.8 @ 320 (T)
Aug 29, 2022
- 默认情况下,MaxVit 窗口大小随 img_size 缩放。添加利用此特性的新 RelPosMlp MaxViT 权重
maxvit_rmlp_nano_rw_256
- 83.0 @ 256, 83.6 @ 320 (T)
Aug 26, 2022
- CoAtNet (https://arxiv.org/abs/2106.04803) 和 MaxVit (https://arxiv.org/abs/2204.01697)
timm
原始模型- 两者都在
maxxvit.py
模型定义中找到,包含许多超出原始论文范围的实验 - 可以从 https://github.com/google-research/maxvit 找到 MaxVit 作者未完成的 Tensorflow 版本
- 两者都在
- 初始 CoAtNet 和 MaxVit timm 预训练权重(正在开发更多)
coatnet_nano_rw_224
- 81.7 @ 224 (T)coatnet_rmlp_nano_rw_224
- 82.0 @ 224, 82.8 @ 320 (T)coatnet_0_rw_224
- 82.4 (T) — 注意:timm ‘0’ coatnet 有 2 个额外的第 3 阶段块coatnet_bn_0_rw_224
- 82.4 (T)maxvit_nano_rw_256
- 82.9 @ 256 (T)coatnet_rmlp_1_rw_224
- 83.4 @ 224, 84 @ 320 (T)coatnet_1_rw_224
- 83.6 @ 224 (G)- (T) = 使用
bits_and_tpu
分支训练代码在 TPU 上训练,(G) = GPU 训练
- GCVit(权重改编自 https://github.com/NVlabs/GCVit,代码 100%
timm
重写以用于许可证目的) - MViT-V2(多尺度 vit,改编自 https://github.com/facebookresearch/mvit)
- EfficientFormer(改编自 https://github.com/snap-research/EfficientFormer)
- PyramidVisionTransformer-V2(改编自 https://github.com/whai362/PVT)
- 对 LayerNorm 和 GroupNorm 的 ‘Fast Norm’ 支持,避免了 float32 与 AMP 的向上转换(如果 APEX LN 可用,则使用 APEX LN 以进一步提升)
Aug 15, 2022
- 添加了 ConvNeXt atto 权重
convnext_atto
- 75.7 @ 224, 77.0 @ 288convnext_atto_ols
- 75.9 @ 224, 77.2 @ 288
Aug 5, 2022
- 更多自定义 ConvNeXt 更小模型定义及其权重
convnext_femto
- 77.5 @ 224, 78.7 @ 288convnext_femto_ols
- 77.9 @ 224, 78.9 @ 288convnext_pico
- 79.5 @ 224, 80.4 @ 288convnext_pico_ols
- 79.5 @ 224, 80.5 @ 288convnext_nano_ols
- 80.9 @ 224, 81.6 @ 288
- 更新了 EdgeNeXt 以改进 ONNX 导出,从原始版本 (https://github.com/mmaaz60/EdgeNeXt) 添加了新的基础变体和权重
July 28, 2022
- 添加了新近铸造的 DeiT-III Medium(宽度=512,深度=12,num_heads=8)模型权重。感谢 Hugo Touvron!
July 27, 2022
- 所有运行时基准测试和验证结果 csv 文件终于更新了!
- 添加了一些权重和模型定义
darknetaa53
- 79.8 @ 256, 80.5 @ 288convnext_nano
- 80.8 @ 224, 81.5 @ 288cs3sedarknet_l
- 81.2 @ 256, 81.8 @ 288cs3darknet_x
- 81.8 @ 256, 82.2 @ 288cs3sedarknet_x
- 82.2 @ 256, 82.7 @ 288cs3edgenet_x
- 82.2 @ 256, 82.7 @ 288cs3se_edgenet_x
- 82.8 @ 256, 83.5 @ 320
- 上面的
cs3*
权重均在 TPU 上使用bits_and_tpu
分支进行训练。感谢 TRC 计划! - 为 ConvNeXt 添加 output_stride=8 和 16 支持(扩张)
- 修复了 deit3 模型无法调整 pos_emb 大小的问题
- 版本 0.6.7 PyPi 发布(/w 自 0.6.5 以来的上述错误修复和新权重)
July 8, 2022
更多模型,更多修复
- 添加了官方研究模型(带权重)
- 来自 (https://github.com/mmaaz60/EdgeNeXt) 的 EdgeNeXt
- 来自 (https://github.com/apple/ml-cvnets) 的 MobileViT-V2
- 来自 (https://github.com/facebookresearch/deit) 的 DeiT III (Revenge of the ViT)
- 我自己的模型
- 根据请求添加了小的
ResNet
定义,基本型和瓶颈型都重复 1 个块(resnet10 和 resnet14) - 使用 dataclass 配置重构了
CspNet
,简化了 CrossStage3 (cs3
) 选项。这些更接近 YOLO-v5+ 骨干网络定义。 - 更多相对位置 vit 调整。训练了两个
srelpos
(共享相对位置)模型,以及一个带有类令牌的 medium 模型。 - 为 EdgeNeXt 添加了备用下采样模式,并训练了一个
small
模型。比原始 small 模型更好,但不如他们新的 USI 训练权重。
- 根据请求添加了小的
- 我自己的模型权重结果(所有 ImageNet-1k 训练)
resnet10t
- 66.5 @ 176, 68.3 @ 224resnet14t
- 71.3 @ 176, 72.3 @ 224resnetaa50
- 80.6 @ 224 , 81.6 @ 288darknet53
- 80.0 @ 256, 80.5 @ 288cs3darknet_m
- 77.0 @ 256, 77.6 @ 288cs3darknet_focus_m
- 76.7 @ 256, 77.3 @ 288cs3darknet_l
- 80.4 @ 256, 80.9 @ 288cs3darknet_focus_l
- 80.3 @ 256, 80.9 @ 288vit_srelpos_small_patch16_224
- 81.1 @ 224, 82.1 @ 320vit_srelpos_medium_patch16_224
- 82.3 @ 224, 83.1 @ 320vit_relpos_small_patch16_cls_224
- 82.6 @ 224, 83.6 @ 320edgnext_small_rw
- 79.6 @ 224, 80.4 @ 320
- 上面的
cs3
、darknet
和vit_*relpos
权重均在 TPU 上训练,这要归功于 TRC 计划!其余在过热的 GPU 上训练。 - Hugging Face Hub 支持修复已验证,演示笔记本 TBA
- 预训练权重/配置可以从外部加载(即从本地磁盘加载),并支持头部适配。
- 添加了更改
timm
数据集/读取器扫描的图像扩展名的支持。请参阅 (https://github.com/rwightman/pytorch-image-models/pull/1274#issuecomment-1178303103) - 默认 ConvNeXt LayerNorm 实现使用
F.layer_norm(x.permute(0, 2, 3, 1), ...).permute(0, 3, 1, 2)
通过所有情况下的LayerNorm2d
。- 在某些硬件(例如带有 CL 的 Ampere)上比以前的自定义实现稍慢,但总体而言,在更广泛的硬件/PyTorch 版本范围内,回归较少。
- 以前的实现作为
LayerNormExp2d
存在于models/layers/norm.py
中
- 大量错误修复
- 目前正在测试即将发布的 PyPi 0.6.x 版本
- 更大模型的 LeViT 预训练仍然是 WIP,它们在没有蒸馏的情况下训练效果不佳/不容易训练。是时候添加蒸馏支持了吗(终于)?
- ImageNet-22k 权重训练 + 微调正在进行中,多权重支持的工作(缓慢地)进行中(权重非常多,叹气)……
May 13, 2022
- 从 (https://github.com/microsoft/Swin-Transformer) 添加了官方 Swin-V2 模型和权重。已清理以支持 torchscript。
- 对现有
timm
Swin-V2-CR 实现进行了一些重构,可能会做更多工作,使部分更接近官方版本,并决定是否合并某些方面。 - 更多 Vision Transformer 相对位置/残差后归一化实验(全部在 TPU 上训练,感谢 TRC 计划)
vit_relpos_small_patch16_224
- 81.5 @ 224, 82.5 @ 320 — rel pos、层缩放、无类令牌、平均池化vit_relpos_medium_patch16_rpn_224
- 82.3 @ 224, 83.1 @ 320 — rel pos + res-post-norm、无类令牌、平均池化vit_relpos_medium_patch16_224
- 82.5 @ 224, 83.3 @ 320 — rel pos、层缩放、无类令牌、平均池化vit_relpos_base_patch16_gapcls_224
- 82.8 @ 224, 83.9 @ 320 — rel pos、层缩放、类令牌、平均池化(错误地)
- 将 512 维、8 头 ‘medium’ ViT 模型变体重新启用(在 2020 年首次 ViT 实现的 pre DeiT ‘small’ 模型中使用后)
- 添加 ViT 相对位置支持,用于在现有实现和官方 Swin-V2 实现中的一些新增功能之间切换,以进行未来试验
- Sequencer2D 实现 (https://arxiv.org/abs/2205.01972),通过作者的 PR 添加 (https://github.com/okojoalg)
May 2, 2022
- Vision Transformer 实验添加相对位置(Swin-V2 log-coord)(
vision_transformer_relpos.py
) 和残差后归一化分支(来自 Swin-V2)(vision_transformer*.py
)vit_relpos_base_patch32_plus_rpn_256
- 79.5 @ 256, 80.6 @ 320 — rel pos + 扩展宽度 + res-post-norm、无类令牌、平均池化vit_relpos_base_patch16_224
- 82.5 @ 224, 83.6 @ 320 — rel pos、层缩放、无类令牌、平均池化vit_base_patch16_rpn_224
- 82.3 @ 224 — rel pos + res-post-norm、无类令牌、平均池化
- Vision Transformer 重构以删除表示层,该表示层仅在初始 vit 中使用,并且自更新的预训练(即
How to Train Your ViT
)以来很少使用 vit_*
模型支持删除类令牌、使用全局平均池化、使用 fc_norm(ala beit、mae)。
April 22, 2022
timm
模型现在在 fast.ai 中获得官方支持!恰逢新的实用深度学习课程推出。timmdocs
文档链接已更新为 timm.fast.ai。- 在 TPU 训练的 系列 中添加了另外两个模型权重。一些 In22k 预训练仍在进行中。
seresnext101d_32x8d
- 83.69 @ 224, 84.35 @ 288seresnextaa101d_32x8d
(抗锯齿,带 AvgPool2d)- 83.85 @ 224, 84.57 @ 288
March 23, 2022
- 向基础 vit 模型添加
ParallelBlock
和LayerScale
选项,以支持 关于 ViT 的每个人都应该知道的三件事 中的模型配置 - 使用(接近)A2 配方训练的
convnext_tiny_hnf
(头部归一化优先)权重,top-1 准确率为 82.2%,可以通过更多 epoch 获得更好的结果。
March 21, 2022
- 合并
norm_norm_norm
。重要提示:此更新适用于即将发布的 0.6.x 版本,可能会在一段时间内使主分支不稳定。如果需要稳定性,可以使用0.5.x
分支或之前的 0.5.x 版本。 - 如本 版本 中所述的重大权重更新(全部在 TPU 上训练)
regnety_040
- 82.3 @ 224, 82.96 @ 288regnety_064
- 83.0 @ 224, 83.65 @ 288regnety_080
- 83.17 @ 224, 83.86 @ 288regnetv_040
- 82.44 @ 224, 83.18 @ 288 (timm pre-act)regnetv_064
- 83.1 @ 224, 83.71 @ 288 (timm pre-act)regnetz_040
- 83.67 @ 256, 84.25 @ 320regnetz_040h
- 83.77 @ 256, 84.5 @ 320 (头部带有额外的 fc)resnetv2_50d_gn
- 80.8 @ 224, 81.96 @ 288 (pre-act GroupNorm)resnetv2_50d_evos
80.77 @ 224, 82.04 @ 288 (pre-act EvoNormS)regnetz_c16_evos
- 81.9 @ 256, 82.64 @ 320 (EvoNormS)regnetz_d8_evos
- 83.42 @ 256, 84.04 @ 320 (EvoNormS)xception41p
- 82 @ 299 (timm pre-act)xception65
- 83.17 @ 299xception65p
- 83.14 @ 299 (timm pre-act)resnext101_64x4d
- 82.46 @ 224, 83.16 @ 288seresnext101_32x8d
- 83.57 @ 224, 84.270 @ 288resnetrs200
- 83.85 @ 256, 84.44 @ 320
- 修复了 HuggingFace hub 支持,并为允许预训练模型定义和权重的替代 ‘config sources’ 奠定了初步基础(通用本地文件/远程 url 支持即将推出)
- 添加了 SwinTransformer-V2 实现。由 Christoph Reich 提交。我自己正在进行训练实验和模型更改,因此预计会出现兼容性中断。
- 从 https://github.com/microsoft/Cream/tree/main/AutoFormerV2 添加了 Swin-S3 (AutoFormerV2) 模型/权重
- MobileViT 模型及其权重改编自 https://github.com/apple/ml-cvnets
- PoolFormer 模型及其权重改编自 https://github.com/sail-sg/poolformer
- VOLO 模型及其权重改编自 https://github.com/sail-sg/volo
- 在实验非 BatchNorm 归一化层(例如 EvoNorm、FilterResponseNorm、GroupNorm 等)方面做了大量工作
- 增强了对添加到许多模型中的备用归一化 + 激活 (‘NormAct’) 层的支持,尤其是 EfficientNet/MobileNetV3、RegNet 和对齐的 Xception
- 为 EfficientNet 系列添加了分组卷积支持
- 为所有模型添加了 ‘group matching’ API,以允许对模型参数进行分组,以便应用 ‘layer-wise’ LR 衰减,LR 缩放添加到 LR 调度器
- 为许多模型添加了梯度检查点支持
- 将
forward_head(x, pre_logits=False)
函数添加到所有模型,以允许分别调用forward_features
和forward_head
- 所有 vision transformer 和 vision MLP 模型更新后,将从
foward_features
返回非池化/非标记选择的特征,为了与 CNN 模型保持一致,标记选择或池化现在应用于forward_head
中。
2022 年 2 月 2 日
- Chris Hughes 昨天在他的博客上发布了对
timm
的详尽介绍。非常值得一读。 《PyTorch 图像模型 (timm) 入门:从业者指南》 - 我目前正在准备将
norm_norm_norm
分支合并回主分支 (版本 0.6.x),预计在下周左右。- 这些更改比平常更广泛,可能会 destabilize 并破坏一些模型 API 的使用(目标是完全向后兼容)。因此,请注意
pip install git+https://github.com/rwightman/pytorch-image-models
安装! 0.5.x
版本和0.5.x
分支将保持稳定,并进行一到两次的 cherry pick,直到尘埃落定。如果您想要稳定版本,建议暂时坚持使用 pypi 安装。
- 这些更改比平常更广泛,可能会 destabilize 并破坏一些模型 API 的使用(目标是完全向后兼容)。因此,请注意
2022 年 1 月 14 日
- 版本 0.5.4 即将发布到 pypi。距离上次 pypi 更新已经有一段时间了,风险较高的更改将很快合并到主分支…
- 添加 ConvNeXT 模型,包含来自官方实现的权重 (https://github.com/facebookresearch/ConvNeXt),一些性能调整,并与 timm 特性兼容。
- 尝试训练了一些小型(约 1.8-3M 参数)/移动优化的模型,到目前为止,其中一些效果不错,更多模型正在开发中…
mnasnet_small
- Top-1 准确率 65.6mobilenetv2_050
- 65.9lcnet_100/075/050
- 72.1 / 68.8 / 63.1semnasnet_075
- 73fbnetv3_b/d/g
- 79.1 / 79.7 / 82.0
- TinyNet 模型由 rsomani95 添加。
- LCNet 通过 MobileNetV3 架构添加。
1月5日,2023年
- 将 ConvNeXt-V2 模型和权重添加到现有的
convnext.py
中- 论文: ConvNeXt V2: Co-designing and Scaling ConvNets with Masked Autoencoders
- 参考实现:https://github.com/facebookresearch/ConvNeXt-V2 (注意:权重目前为 CC-BY-NC 许可)。
12月23日,2022年 🎄☃
- 添加了 FlexiViT 模型和权重,来自 https://github.com/google-research/big_vision(请查看论文 https://arxiv.org/abs/2212.08013)
- 注意:目前调整大小在模型创建时是静态的,即时动态/训练 patch 大小采样正在开发中 (WIP)
- 更多模型已更新为多权重,现在可以通过 HF hub 下载(convnext、efficientnet、mobilenet、vision_transformer*、beit)
- 更多模型预训练标签和调整,一些模型名称已更改(正在进行弃用翻译,目前将主分支视为 DEV 分支,稳定使用请使用 0.6.x)
- 涌现出更多 ImageNet-12k(22k 的子集)预训练模型
efficientnet_b5.in12k_ft_in1k
- 85.9 @ 448x448vit_medium_patch16_gap_384.in12k_ft_in1k
- 85.5 @ 384x384vit_medium_patch16_gap_256.in12k_ft_in1k
- 84.5 @ 256x256convnext_nano.in12k_ft_in1k
- 82.9 @ 288x288
12月8日,2022年
- 将 ‘EVA l’ 添加到
vision_transformer.py
,MAE 风格的 ViT-L/14 MIM 预训练,使用 EVA-CLIP 目标,在 ImageNet-1k 上进行 FT(对于某些模型,使用 ImageNet-22k 作为中间步骤)
模型 | Top1 | 参数量 | gmac | macts | hub |
---|---|---|---|---|---|
eva_large_patch14_336.in22k_ft_in22k_in1k | 89.2 | 304.5 | 191.1 | 270.2 | 链接 |
eva_large_patch14_336.in22k_ft_in1k | 88.7 | 304.5 | 191.1 | 270.2 | 链接 |
eva_large_patch14_196.in22k_ft_in22k_in1k | 88.6 | 304.1 | 61.6 | 63.5 | 链接 |
eva_large_patch14_196.in22k_ft_in1k | 87.9 | 304.1 | 61.6 | 63.5 | 链接 |
Dec 6, 2022
- 在
beit.py
中添加 ‘EVA g’、BEiT 风格的 ViT-g/14 模型权重,包括 MIM 预训练和 CLIP 预训练。
模型 | Top1 | 参数量 | gmac | macts | hub |
---|---|---|---|---|---|
eva_giant_patch14_560.m30m_ft_in22k_in1k | 89.8 | 1014.4 | 1906.8 | 2577.2 | 链接 |
eva_giant_patch14_336.m30m_ft_in22k_in1k | 89.6 | 1013 | 620.6 | 550.7 | 链接 |
eva_giant_patch14_336.clip_ft_in1k | 89.4 | 1013 | 620.6 | 550.7 | 链接 |
eva_giant_patch14_224.clip_ft_in1k | 89.1 | 1012.6 | 267.2 | 192.6 | 链接 |
Dec 5, 2022
- 多权重支持 (
model_arch.pretrained_tag
) 的预发布版本 (0.8.0dev0
)。使用pip install --pre timm
安装- vision_transformer、maxvit、convnext 是首批支持的三种模型实现
- 模型名称正在随之更改(之前的 _21k 等函数将会合并),仍在整理弃用处理
- 可能存在错误,但我需要反馈,所以请尝试一下
- 如果需要稳定性,请使用 0.6.x pypi 版本或从 0.6.x 分支 克隆
- 在 train/validate/inference/benchmark 中添加了对 PyTorch 2.0 compile 的支持,使用
--torchcompile
参数 - 推理脚本允许更多地控制输出,选择 k 以获取前 k 类的索引 + 概率 json、csv 或 parquet 输出
- 添加了一整套来自 LAION-2B 和原始 OpenAI CLIP 模型的微调 CLIP 图像塔权重
模型 | Top1 | 参数量 | gmac | macts | hub |
---|---|---|---|---|---|
vit_huge_patch14_clip_336.laion2b_ft_in12k_in1k | 88.6 | 632.5 | 391 | 407.5 | 链接 |
vit_large_patch14_clip_336.openai_ft_in12k_in1k | 88.3 | 304.5 | 191.1 | 270.2 | 链接 |
vit_huge_patch14_clip_224.laion2b_ft_in12k_in1k | 88.2 | 632 | 167.4 | 139.4 | 链接 |
vit_large_patch14_clip_336.laion2b_ft_in12k_in1k | 88.2 | 304.5 | 191.1 | 270.2 | 链接 |
vit_large_patch14_clip_224.openai_ft_in12k_in1k | 88.2 | 304.2 | 81.1 | 88.8 | 链接 |
vit_large_patch14_clip_224.laion2b_ft_in12k_in1k | 87.9 | 304.2 | 81.1 | 88.8 | 链接 |
vit_large_patch14_clip_224.openai_ft_in1k | 87.9 | 304.2 | 81.1 | 88.8 | 链接 |
vit_large_patch14_clip_336.laion2b_ft_in1k | 87.9 | 304.5 | 191.1 | 270.2 | 链接 |
vit_huge_patch14_clip_224.laion2b_ft_in1k | 87.6 | 632 | 167.4 | 139.4 | 链接 |
vit_large_patch14_clip_224.laion2b_ft_in1k | 87.3 | 304.2 | 81.1 | 88.8 | 链接 |
vit_base_patch16_clip_384.laion2b_ft_in12k_in1k | 87.2 | 86.9 | 55.5 | 101.6 | 链接 |
vit_base_patch16_clip_384.openai_ft_in12k_in1k | 87 | 86.9 | 55.5 | 101.6 | 链接 |
vit_base_patch16_clip_384.laion2b_ft_in1k | 86.6 | 86.9 | 55.5 | 101.6 | 链接 |
vit_base_patch16_clip_384.openai_ft_in1k | 86.2 | 86.9 | 55.5 | 101.6 | 链接 |
vit_base_patch16_clip_224.laion2b_ft_in12k_in1k | 86.2 | 86.6 | 17.6 | 23.9 | 链接 |
vit_base_patch16_clip_224.openai_ft_in12k_in1k | 85.9 | 86.6 | 17.6 | 23.9 | 链接 |
vit_base_patch32_clip_448.laion2b_ft_in12k_in1k | 85.8 | 88.3 | 17.9 | 23.9 | 链接 |
vit_base_patch16_clip_224.laion2b_ft_in1k | 85.5 | 86.6 | 17.6 | 23.9 | 链接 |
vit_base_patch32_clip_384.laion2b_ft_in12k_in1k | 85.4 | 88.3 | 13.1 | 16.5 | 链接 |
vit_base_patch16_clip_224.openai_ft_in1k | 85.3 | 86.6 | 17.6 | 23.9 | 链接 |
vit_base_patch32_clip_384.openai_ft_in12k_in1k | 85.2 | 88.3 | 13.1 | 16.5 | 链接 |
vit_base_patch32_clip_224.laion2b_ft_in12k_in1k | 83.3 | 88.2 | 4.4 | 5 | 链接 |
vit_base_patch32_clip_224.laion2b_ft_in1k | 82.6 | 88.2 | 4.4 | 5 | 链接 |
vit_base_patch32_clip_224.openai_ft_in1k | 81.9 | 88.2 | 4.4 | 5 | 链接 |
- 从官方实现 https://github.com/google-research/maxvit 移植 MaxViT Tensorflow 权重
- 对于放大的 384/512 in21k 微调权重,存在比预期更大的下降,可能缺少细节,但 21k FT 似乎对小的预处理很敏感
模型 | Top1 | 参数量 | gmac | macts | hub |
---|---|---|---|---|---|
maxvit_xlarge_tf_512.in21k_ft_in1k | 88.5 | 475.8 | 534.1 | 1413.2 | 链接 |
maxvit_xlarge_tf_384.in21k_ft_in1k | 88.3 | 475.3 | 292.8 | 668.8 | 链接 |
maxvit_base_tf_512.in21k_ft_in1k | 88.2 | 119.9 | 138 | 704 | 链接 |
maxvit_large_tf_512.in21k_ft_in1k | 88 | 212.3 | 244.8 | 942.2 | 链接 |
maxvit_large_tf_384.in21k_ft_in1k | 88 | 212 | 132.6 | 445.8 | 链接 |
maxvit_base_tf_384.in21k_ft_in1k | 87.9 | 119.6 | 73.8 | 332.9 | 链接 |
maxvit_base_tf_512.in1k | 86.6 | 119.9 | 138 | 704 | 链接 |
maxvit_large_tf_512.in1k | 86.5 | 212.3 | 244.8 | 942.2 | 链接 |
maxvit_base_tf_384.in1k | 86.3 | 119.6 | 73.8 | 332.9 | 链接 |
maxvit_large_tf_384.in1k | 86.2 | 212 | 132.6 | 445.8 | 链接 |
maxvit_small_tf_512.in1k | 86.1 | 69.1 | 67.3 | 383.8 | 链接 |
maxvit_tiny_tf_512.in1k | 85.7 | 31 | 33.5 | 257.6 | 链接 |
maxvit_small_tf_384.in1k | 85.5 | 69 | 35.9 | 183.6 | 链接 |
maxvit_tiny_tf_384.in1k | 85.1 | 31 | 17.5 | 123.4 | 链接 |
maxvit_large_tf_224.in1k | 84.9 | 211.8 | 43.7 | 127.4 | 链接 |
maxvit_base_tf_224.in1k | 84.9 | 119.5 | 24 | 95 | 链接 |
maxvit_small_tf_224.in1k | 84.4 | 68.9 | 11.7 | 53.2 | 链接 |
maxvit_tiny_tf_224.in1k | 83.4 | 30.9 | 5.6 | 35.8 | 链接 |
Oct 15, 2022
- 训练和验证脚本增强
- 非 GPU(即 CPU)设备支持
- 训练脚本的 SLURM 兼容性
- HF 数据集支持(通过 ReaderHfds)
- TFDS/WDS 数据加载改进(针对分布式使用的样本填充/包装已修复,与样本计数估计相关)
- 脚本/加载器的 in_chans !=3 支持
- Adan 优化器
- 可以通过 args 启用每步 LR 调度
- 数据集 ‘parsers’ 重命名为 ‘readers’,更具描述性
- AMP args 已更改,APEX 通过
--amp-impl apex
,bfloat16 支持通过--amp-dtype bfloat16
- 主分支切换到 0.7.x 版本,0.6x 分支用于仅添加权重的稳定版本
- master -> main 分支重命名
Oct 10, 2022
maxxvit
系列中更多权重,包括首个基于 ConvNeXt 块的coatnext
和maxxvit
实验coatnext_nano_rw_224
- 82.0 @ 224 (G) —(使用 ConvNeXt conv 块,无 BatchNorm)maxxvit_rmlp_nano_rw_256
- 83.0 @ 256, 83.7 @ 320 (G) (使用 ConvNeXt conv 块,无 BN)maxvit_rmlp_small_rw_224
- 84.5 @ 224, 85.1 @ 320 (G)maxxvit_rmlp_small_rw_256
- 84.6 @ 256, 84.9 @ 288 (G) — 可能可以训练得更好,hparams 需要调整(使用 ConvNeXt 块,无 BN)coatnet_rmlp_2_rw_224
- 84.6 @ 224, 85 @ 320 (T)- 注意:官方 MaxVit 权重 (in1k) 已在 https://github.com/google-research/maxvit 上发布 — 由于我的实现是独立于他们的实现创建的,并且有一些小的差异 + 整个 TF 相同填充的乐趣,因此需要额外的工作来移植和适配。
Sept 23, 2022
- LAION-2B CLIP 图像塔支持作为微调或特征的预训练骨干网络(无分类器)
- vit_base_patch32_224_clip_laion2b
- vit_large_patch14_224_clip_laion2b
- vit_huge_patch14_224_clip_laion2b
- vit_giant_patch14_224_clip_laion2b
Sept 7, 2022
- Hugging Face
timm
文档 主页现已存在,未来请在此处查找更多内容 - 从 https://github.com/microsoft/unilm/tree/master/beit2 添加基础模型和大型 224x224 模型的 BEiT-v2 权重
- 在
maxxvit
系列中添加更多权重,包括pico
(750 万参数,1.9 GMACs)、两个tiny
变体maxvit_rmlp_pico_rw_256
- 80.5 @ 256, 81.3 @ 320 (T)maxvit_tiny_rw_224
- 83.5 @ 224 (G)maxvit_rmlp_tiny_rw_256
- 84.2 @ 256, 84.8 @ 320 (T)
Aug 29, 2022
- 默认情况下,MaxVit 窗口大小随 img_size 缩放。添加利用此特性的新 RelPosMlp MaxViT 权重
maxvit_rmlp_nano_rw_256
- 83.0 @ 256, 83.6 @ 320 (T)
Aug 26, 2022
- CoAtNet (https://arxiv.org/abs/2106.04803) 和 MaxVit (https://arxiv.org/abs/2204.01697)
timm
原始模型- 两者都在
maxxvit.py
模型定义中找到,包含许多超出原始论文范围的实验 - 可以从 https://github.com/google-research/maxvit 找到 MaxVit 作者未完成的 Tensorflow 版本
- 两者都在
- 初始 CoAtNet 和 MaxVit timm 预训练权重(正在开发更多)
coatnet_nano_rw_224
- 81.7 @ 224 (T)coatnet_rmlp_nano_rw_224
- 82.0 @ 224, 82.8 @ 320 (T)coatnet_0_rw_224
- 82.4 (T) — 注意:timm ‘0’ coatnet 有 2 个额外的第 3 阶段块coatnet_bn_0_rw_224
- 82.4 (T)maxvit_nano_rw_256
- 82.9 @ 256 (T)coatnet_rmlp_1_rw_224
- 83.4 @ 224, 84 @ 320 (T)coatnet_1_rw_224
- 83.6 @ 224 (G)- (T) = 使用
bits_and_tpu
分支训练代码在 TPU 上训练,(G) = GPU 训练
- GCVit(权重改编自 https://github.com/NVlabs/GCVit,代码 100%
timm
重写以用于许可证目的) - MViT-V2(多尺度 vit,改编自 https://github.com/facebookresearch/mvit)
- EfficientFormer(改编自 https://github.com/snap-research/EfficientFormer)
- PyramidVisionTransformer-V2(改编自 https://github.com/whai362/PVT)
- 对 LayerNorm 和 GroupNorm 的 ‘Fast Norm’ 支持,避免了 float32 与 AMP 的向上转换(如果 APEX LN 可用,则使用 APEX LN 以进一步提升)
Aug 15, 2022
- 添加了 ConvNeXt atto 权重
convnext_atto
- 75.7 @ 224, 77.0 @ 288convnext_atto_ols
- 75.9 @ 224, 77.2 @ 288
Aug 5, 2022
- 更多自定义 ConvNeXt 更小模型定义及其权重
convnext_femto
- 77.5 @ 224, 78.7 @ 288convnext_femto_ols
- 77.9 @ 224, 78.9 @ 288convnext_pico
- 79.5 @ 224, 80.4 @ 288convnext_pico_ols
- 79.5 @ 224, 80.5 @ 288convnext_nano_ols
- 80.9 @ 224, 81.6 @ 288
- 更新了 EdgeNeXt 以改进 ONNX 导出,从原始版本 (https://github.com/mmaaz60/EdgeNeXt) 添加了新的基础变体和权重
July 28, 2022
- 添加了新近铸造的 DeiT-III Medium(宽度=512,深度=12,num_heads=8)模型权重。感谢 Hugo Touvron!
July 27, 2022
- 所有运行时基准测试和验证结果 csv 文件都是最新的!
- 添加了一些权重和模型定义
darknetaa53
- 79.8 @ 256, 80.5 @ 288convnext_nano
- 80.8 @ 224, 81.5 @ 288cs3sedarknet_l
- 81.2 @ 256, 81.8 @ 288cs3darknet_x
- 81.8 @ 256, 82.2 @ 288cs3sedarknet_x
- 82.2 @ 256, 82.7 @ 288cs3edgenet_x
- 82.2 @ 256, 82.7 @ 288cs3se_edgenet_x
- 82.8 @ 256, 83.5 @ 320
- 上面的
cs3*
权重均在 TPU 上使用bits_and_tpu
分支进行训练。感谢 TRC 计划! - 为 ConvNeXt 添加 output_stride=8 和 16 支持(扩张)
- 修复了 deit3 模型无法调整 pos_emb 大小的问题
- 版本 0.6.7 PyPi 发布(/w 自 0.6.5 以来的上述错误修复和新权重)
July 8, 2022
更多模型,更多修复
- 添加了官方研究模型(带权重)
- 来自 (https://github.com/mmaaz60/EdgeNeXt) 的 EdgeNeXt
- 来自 (https://github.com/apple/ml-cvnets) 的 MobileViT-V2
- 来自 (https://github.com/facebookresearch/deit) 的 DeiT III (Revenge of the ViT)
- 我自己的模型
- 根据请求添加了小的
ResNet
定义,基本型和瓶颈型都重复 1 个块(resnet10 和 resnet14) - 使用 dataclass 配置重构了
CspNet
,简化了 CrossStage3 (cs3
) 选项。这些更接近 YOLO-v5+ 骨干网络定义。 - 更多相对位置 vit 调整。训练了两个
srelpos
(共享相对位置)模型,以及一个带有类令牌的 medium 模型。 - 为 EdgeNeXt 添加了备用下采样模式,并训练了一个
small
模型。比原始 small 模型更好,但不如他们新的 USI 训练权重。
- 根据请求添加了小的
- 我自己的模型权重结果(所有 ImageNet-1k 训练)
resnet10t
- 66.5 @ 176, 68.3 @ 224resnet14t
- 71.3 @ 176, 72.3 @ 224resnetaa50
- 80.6 @ 224 , 81.6 @ 288darknet53
- 80.0 @ 256, 80.5 @ 288cs3darknet_m
- 77.0 @ 256, 77.6 @ 288cs3darknet_focus_m
- 76.7 @ 256, 77.3 @ 288cs3darknet_l
- 80.4 @ 256, 80.9 @ 288cs3darknet_focus_l
- 80.3 @ 256, 80.9 @ 288vit_srelpos_small_patch16_224
- 81.1 @ 224, 82.1 @ 320vit_srelpos_medium_patch16_224
- 82.3 @ 224, 83.1 @ 320vit_relpos_small_patch16_cls_224
- 82.6 @ 224, 83.6 @ 320edgnext_small_rw
- 79.6 @ 224, 80.4 @ 320
- 上面的
cs3
、darknet
和vit_*relpos
权重均在 TPU 上训练,这要归功于 TRC 计划!其余在过热的 GPU 上训练。 - Hugging Face Hub 支持修复已验证,演示笔记本 TBA
- 预训练权重/配置可以从外部加载(即从本地磁盘加载),并支持头部适配。
- 添加了更改
timm
datasets/parsers 扫描的图像扩展名的支持。请参阅 (https://github.com/rwightman/pytorch-image-models/pull/1274#issuecomment-1178303103) - 默认 ConvNeXt LayerNorm 实现使用
F.layer_norm(x.permute(0, 2, 3, 1), ...).permute(0, 3, 1, 2)
通过所有情况下的LayerNorm2d
。- 在某些硬件(例如带有 CL 的 Ampere)上比以前的自定义实现稍慢,但总体而言,在更广泛的硬件/PyTorch 版本范围内,回归较少。
- 以前的实现作为
LayerNormExp2d
存在于models/layers/norm.py
中
- 大量错误修复
- 目前正在测试即将发布的 PyPi 0.6.x 版本
- 更大模型的 LeViT 预训练仍然是 WIP,它们在没有蒸馏的情况下训练效果不佳/不容易训练。是时候添加蒸馏支持了吗(终于)?
- ImageNet-22k 权重训练 + 微调正在进行中,多权重支持的工作(缓慢地)进行中(权重非常多,叹气)……
May 13, 2022
- 从 (https://github.com/microsoft/Swin-Transformer) 添加了官方 Swin-V2 模型和权重。已清理以支持 torchscript。
- 对现有
timm
Swin-V2-CR 实现进行了一些重构,可能会做更多工作,使部分更接近官方版本,并决定是否合并某些方面。 - 更多 Vision Transformer 相对位置/残差后归一化实验(全部在 TPU 上训练,感谢 TRC 计划)
vit_relpos_small_patch16_224
- 81.5 @ 224, 82.5 @ 320 — rel pos、层缩放、无类令牌、平均池化vit_relpos_medium_patch16_rpn_224
- 82.3 @ 224, 83.1 @ 320 — rel pos + res-post-norm、无类令牌、平均池化vit_relpos_medium_patch16_224
- 82.5 @ 224, 83.3 @ 320 — rel pos、层缩放、无类令牌、平均池化vit_relpos_base_patch16_gapcls_224
- 82.8 @ 224, 83.9 @ 320 — rel pos、层缩放、类令牌、平均池化(错误地)
- 将 512 维、8 头 ‘medium’ ViT 模型变体重新启用(在 2020 年首次 ViT 实现的 pre DeiT ‘small’ 模型中使用后)
- 添加 ViT 相对位置支持,用于在现有实现和官方 Swin-V2 实现中的一些新增功能之间切换,以进行未来试验
- Sequencer2D 实现 (https://arxiv.org/abs/2205.01972),通过作者的 PR 添加 (https://github.com/okojoalg)
May 2, 2022
- Vision Transformer 实验添加相对位置(Swin-V2 log-coord)(
vision_transformer_relpos.py
) 和残差后归一化分支(来自 Swin-V2)(vision_transformer*.py
)vit_relpos_base_patch32_plus_rpn_256
- 79.5 @ 256, 80.6 @ 320 — rel pos + 扩展宽度 + res-post-norm、无类令牌、平均池化vit_relpos_base_patch16_224
- 82.5 @ 224, 83.6 @ 320 — rel pos、层缩放、无类令牌、平均池化vit_base_patch16_rpn_224
- 82.3 @ 224 — rel pos + res-post-norm、无类令牌、平均池化
- Vision Transformer 重构以删除表示层,该表示层仅在初始 vit 中使用,并且自更新的预训练(即
How to Train Your ViT
)以来很少使用 vit_*
模型支持删除类令牌、使用全局平均池化、使用 fc_norm(ala beit、mae)。
April 22, 2022
timm
模型现在在 fast.ai 中获得官方支持!恰逢新的实用深度学习课程推出。timmdocs
文档链接已更新为 timm.fast.ai。- 在 TPU 训练的 系列 中添加了另外两个模型权重。一些 In22k 预训练仍在进行中。
seresnext101d_32x8d
- 83.69 @ 224, 84.35 @ 288seresnextaa101d_32x8d
(抗锯齿,带 AvgPool2d)- 83.85 @ 224, 84.57 @ 288
March 23, 2022
- 向基础 vit 模型添加
ParallelBlock
和LayerScale
选项,以支持 关于 ViT 的每个人都应该知道的三件事 中的模型配置 - 使用(接近)A2 配方训练的
convnext_tiny_hnf
(头部归一化优先)权重,top-1 准确率为 82.2%,可以通过更多 epoch 获得更好的结果。
March 21, 2022
- 合并
norm_norm_norm
。重要提示:此更新适用于即将发布的 0.6.x 版本,可能会在一段时间内使主分支不稳定。如果需要稳定性,可以使用0.5.x
分支或之前的 0.5.x 版本。 - 如本 版本 中所述的重大权重更新(全部在 TPU 上训练)
regnety_040
- 82.3 @ 224, 82.96 @ 288regnety_064
- 83.0 @ 224, 83.65 @ 288regnety_080
- 83.17 @ 224, 83.86 @ 288regnetv_040
- 82.44 @ 224, 83.18 @ 288 (timm pre-act)regnetv_064
- 83.1 @ 224, 83.71 @ 288 (timm pre-act)regnetz_040
- 83.67 @ 256, 84.25 @ 320regnetz_040h
- 83.77 @ 256, 84.5 @ 320 (头部带有额外的 fc)resnetv2_50d_gn
- 80.8 @ 224, 81.96 @ 288 (pre-act GroupNorm)resnetv2_50d_evos
80.77 @ 224, 82.04 @ 288 (pre-act EvoNormS)regnetz_c16_evos
- 81.9 @ 256, 82.64 @ 320 (EvoNormS)regnetz_d8_evos
- 83.42 @ 256, 84.04 @ 320 (EvoNormS)xception41p
- 82 @ 299 (timm pre-act)xception65
- 83.17 @ 299xception65p
- 83.14 @ 299 (timm pre-act)resnext101_64x4d
- 82.46 @ 224, 83.16 @ 288seresnext101_32x8d
- 83.57 @ 224, 84.270 @ 288resnetrs200
- 83.85 @ 256, 84.44 @ 320
- 修复了 HuggingFace hub 支持,并为允许预训练模型定义和权重的替代 ‘config sources’ 奠定了初步基础(通用本地文件/远程 url 支持即将推出)
- 添加了 SwinTransformer-V2 实现。由 Christoph Reich 提交。我自己正在进行训练实验和模型更改,因此预计会出现兼容性中断。
- 从 https://github.com/microsoft/Cream/tree/main/AutoFormerV2 添加了 Swin-S3 (AutoFormerV2) 模型/权重
- MobileViT 模型及其权重改编自 https://github.com/apple/ml-cvnets
- PoolFormer 模型及其权重改编自 https://github.com/sail-sg/poolformer
- VOLO 模型及其权重改编自 https://github.com/sail-sg/volo
- 在实验非 BatchNorm 归一化层(例如 EvoNorm、FilterResponseNorm、GroupNorm 等)方面做了大量工作
- 增强了对添加到许多模型中的备用归一化 + 激活 (‘NormAct’) 层的支持,尤其是 EfficientNet/MobileNetV3、RegNet 和对齐的 Xception
- 为 EfficientNet 系列添加了分组卷积支持
- 为所有模型添加了 ‘group matching’ API,以允许对模型参数进行分组,以便应用 ‘layer-wise’ LR 衰减,LR 缩放添加到 LR 调度器
- 为许多模型添加了梯度检查点支持
- 将
forward_head(x, pre_logits=False)
函数添加到所有模型,以允许分别调用forward_features
和forward_head
- 所有 vision transformer 和 vision MLP 模型更新后,将从
foward_features
返回非池化/非标记选择的特征,为了与 CNN 模型保持一致,标记选择或池化现在应用于forward_head
中。
2022 年 2 月 2 日
- Chris Hughes 昨天在他的博客上发布了对
timm
的详尽介绍。非常值得一读。 《PyTorch 图像模型 (timm) 入门:从业者指南》 - 我目前正在准备将
norm_norm_norm
分支合并回主分支 (版本 0.6.x),预计在下周左右。- 这些更改比平常更广泛,可能会 destabilize 并破坏一些模型 API 的使用(目标是完全向后兼容)。因此,请注意
pip install git+https://github.com/rwightman/pytorch-image-models
安装! 0.5.x
版本和0.5.x
分支将保持稳定,并进行一到两次的 cherry pick,直到尘埃落定。如果您想要稳定版本,建议暂时坚持使用 pypi 安装。
- 这些更改比平常更广泛,可能会 destabilize 并破坏一些模型 API 的使用(目标是完全向后兼容)。因此,请注意
2022 年 1 月 14 日
- 版本 0.5.4 即将发布到 pypi。距离上次 pypi 更新已经有一段时间了,风险较高的更改将很快合并到主分支…
- 添加 ConvNeXT 模型,包含来自官方实现的权重 (https://github.com/facebookresearch/ConvNeXt),一些性能调整,并与 timm 特性兼容。
- 尝试训练了一些小型(约 1.8-3M 参数)/移动优化的模型,到目前为止,其中一些效果不错,更多模型正在开发中…
mnasnet_small
- Top-1 准确率 65.6mobilenetv2_050
- 65.9lcnet_100/075/050
- 72.1 / 68.8 / 63.1semnasnet_075
- 73fbnetv3_b/d/g
- 79.1 / 79.7 / 82.0
- TinyNet 模型由 rsomani95 添加。
- LCNet 通过 MobileNetV3 架构添加。