Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
NielsRogge committed Oct 27, 2021
1 parent 583fd90 commit 3d372c7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/transformers/models/segformer/modeling_segformer.py
Expand Up @@ -322,7 +322,7 @@ def __init__(self, config):
image_size=config.image_size // config.downsampling_rates[i],
patch_size=config.patch_sizes[i],
stride=config.strides[i],
num_channels=config.hidden_sizes[i - 1] if i != 0 else config.num_channels,
num_channels=config.num_channels if i == 0 else config.hidden_sizes[i - 1],
hidden_size=config.hidden_sizes[i],
)
)
Expand Down Expand Up @@ -406,7 +406,6 @@ class SegformerPreTrainedModel(PreTrainedModel):

config_class = SegformerConfig
base_model_prefix = "segformer"
_keys_to_ignore_on_load_missing = [r"position_ids"]

def _init_weights(self, module):
"""Initialize the weights"""
Expand Down

0 comments on commit 3d372c7

Please sign in to comment.