Skip to content

Commit ede9942

Browse files
committed
Fix timm test for minimum version
1 parent 1d5e1ea commit ede9942

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed
Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1+
import timm
12
from tests.encoders import base
3+
from packaging.version import Version
4+
5+
# check if timm >= 1.0.12
6+
timm_encoders = [
7+
"tu-resnet18", # for timm universal traditional-like encoder
8+
"tu-convnext_atto", # for timm universal transformer-like encoder
9+
"tu-darknet17", # for timm universal vgg-like encoder
10+
]
11+
12+
if Version(timm.__version__) >= Version("1.0.12"):
13+
timm_encoders.append("tu-test_resnet.r160_in1k")
214

315

416
class TestTimmUniversalEncoder(base.BaseEncoderTester):
5-
encoder_names = [
6-
"tu-test_resnet.r160_in1k",
7-
"tu-resnet18", # for timm universal traditional-like encoder
8-
"tu-convnext_atto", # for timm universal transformer-like encoder
9-
"tu-darknet17", # for timm universal vgg-like encoder
10-
]
17+
encoder_names = timm_encoders

0 commit comments

Comments
 (0)