Enable instantiating model with pretrained backbone weights (#28214)
* Enable instantiating model with pretrained backbone weights * Update tests so backbone checkpoint isn't passed in * Remove doc updates until changes made in modeling code * Clarify pretrained import * Update configs - docs and validation check * Update src/transformers/utils/backbone_utils.py Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com> * Clarify exception message * Update config init in tests * Add test for when use_timm_backbone=True * Small test updates --------- Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>
This commit is contained in:
@@ -95,6 +95,7 @@ class DPTModelTester:
|
||||
def get_config(self):
|
||||
return DPTConfig(
|
||||
backbone_config=self.get_backbone_config(),
|
||||
backbone=None,
|
||||
neck_hidden_sizes=self.neck_hidden_sizes,
|
||||
fusion_hidden_size=self.fusion_hidden_size,
|
||||
)
|
||||
|
||||
@@ -130,6 +130,7 @@ class DPTModelTester:
|
||||
initializer_range=self.initializer_range,
|
||||
is_hybrid=self.is_hybrid,
|
||||
backbone_config=backbone_config,
|
||||
backbone=None,
|
||||
backbone_featmap_shape=self.backbone_featmap_shape,
|
||||
neck_hidden_sizes=self.neck_hidden_sizes,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user