Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
cd1350ce
Unverified
Commit
cd1350ce
authored
Dec 21, 2023
by
amyeroberts
Committed by
GitHub
Dec 21, 2023
Browse files
Fix slow backbone tests - out_indices must match stage name ordering (#28186)
Indices must match stage name ordering
parent
260b9d21
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
tests/models/auto/test_modeling_auto.py
tests/models/auto/test_modeling_auto.py
+5
-5
No files found.
tests/models/auto/test_modeling_auto.py
View file @
cd1350ce
...
...
@@ -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
,
[
"stage
4
"
,
"stage
3
"
])
model
=
AutoBackbone
.
from_pretrained
(
"microsoft/resnet-18"
,
out_indices
=
[
-
2
,
-
1
])
self
.
assertEqual
(
model
.
out_indices
,
[
-
2
,
-
1
])
self
.
assertEqual
(
model
.
out_features
,
[
"stage
3
"
,
"stage
4
"
])
model
=
AutoBackbone
.
from_pretrained
(
"microsoft/resnet-18"
,
out_features
=
[
"stage2"
,
"stage4"
])
self
.
assertEqual
(
model
.
out_indices
,
[
2
,
4
])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment