From 7f97d016754f561a53c81cc18276d89da077f374 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=81=E5=AE=87?= Date: Fri, 27 Dec 2024 20:07:31 +0800 Subject: [PATCH] Fix: Rename keyword argument in_channels to num_channels (#35289) Fix: Rename keyword argument in_channels to num_channels in some default backbone configs --- .../models/mask2former/configuration_mask2former.py | 2 +- src/transformers/models/maskformer/configuration_maskformer.py | 2 +- src/transformers/models/oneformer/configuration_oneformer.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/transformers/models/mask2former/configuration_mask2former.py b/src/transformers/models/mask2former/configuration_mask2former.py index 5126b3f73cdebd..a01c161e69bb1a 100644 --- a/src/transformers/models/mask2former/configuration_mask2former.py +++ b/src/transformers/models/mask2former/configuration_mask2former.py @@ -171,7 +171,7 @@ def __init__( logger.info("`backbone_config` is `None`. Initializing the config with the default `Swin` backbone.") backbone_config = CONFIG_MAPPING["swin"]( image_size=224, - in_channels=3, + num_channels=3, patch_size=4, embed_dim=96, depths=[2, 2, 18, 2], diff --git a/src/transformers/models/maskformer/configuration_maskformer.py b/src/transformers/models/maskformer/configuration_maskformer.py index d28ef6ca76d295..0adf968eb4a19f 100644 --- a/src/transformers/models/maskformer/configuration_maskformer.py +++ b/src/transformers/models/maskformer/configuration_maskformer.py @@ -131,7 +131,7 @@ def __init__( # fall back to https://huggingface.co/microsoft/swin-base-patch4-window12-384-in22k backbone_config = SwinConfig( image_size=384, - in_channels=3, + num_channels=3, patch_size=4, embed_dim=128, depths=[2, 2, 18, 2], diff --git a/src/transformers/models/oneformer/configuration_oneformer.py b/src/transformers/models/oneformer/configuration_oneformer.py index 86f56a1f571b94..d16831013f1360 100644 --- a/src/transformers/models/oneformer/configuration_oneformer.py +++ b/src/transformers/models/oneformer/configuration_oneformer.py @@ -201,7 +201,7 @@ def __init__( logger.info("`backbone_config` is unset. Initializing the config with the default `Swin` backbone.") backbone_config = CONFIG_MAPPING["swin"]( image_size=224, - in_channels=3, + num_channels=3, patch_size=4, embed_dim=96, depths=[2, 2, 6, 2],