From cd1350ce9bec0009ff37b3287a5acde064be93a7 Mon Sep 17 00:00:00 2001 From: amyeroberts <22614925+amyeroberts@users.noreply.github.com> Date: Thu, 21 Dec 2023 18:16:50 +0000 Subject: [PATCH] Fix slow backbone tests - out_indices must match stage name ordering (#28186) Indices must match stage name ordering --- tests/models/auto/test_modeling_auto.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/models/auto/test_modeling_auto.py b/tests/models/auto/test_modeling_auto.py index 41f5251748..7c47f39ea6 100644 --- a/tests/models/auto/test_modeling_auto.py +++ b/tests/models/auto/test_modeling_auto.py @@ -244,8 +244,8 @@ class AutoModelTest(unittest.TestCase): self.assertIsInstance(model, TimmBackbone) # Check kwargs are correctly passed to the backbone - model = AutoBackbone.from_pretrained("resnet18", use_timm_backbone=True, out_indices=(-1, -2)) - self.assertEqual(model.out_indices, (-1, -2)) + model = AutoBackbone.from_pretrained("resnet18", use_timm_backbone=True, out_indices=(-2, -1)) + self.assertEqual(model.out_indices, (-2, -1)) # Check out_features cannot be passed to Timm backbones with self.assertRaises(ValueError): @@ -259,9 +259,9 @@ class AutoModelTest(unittest.TestCase): self.assertIsInstance(model, ResNetBackbone) # Check kwargs are correctly passed to the backbone - model = AutoBackbone.from_pretrained("microsoft/resnet-18", out_indices=[-1, -2]) - self.assertEqual(model.out_indices, [-1, -2]) - self.assertEqual(model.out_features, ["stage4", "stage3"]) + model = AutoBackbone.from_pretrained("microsoft/resnet-18", out_indices=[-2, -1]) + self.assertEqual(model.out_indices, [-2, -1]) + self.assertEqual(model.out_features, ["stage3", "stage4"]) model = AutoBackbone.from_pretrained("microsoft/resnet-18", out_features=["stage2", "stage4"]) self.assertEqual(model.out_indices, [2, 4])