Skip to content

Commit 524bcae

Browse files
committed
Update compile test
1 parent 51e0a67 commit 524bcae

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

docs/encoders.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,14 @@ densenet201 imagenet 18M
9797
densenet161 imagenet 26M ✅ ✅ ✅
9898
inceptionresnetv2 imagenet / imagenet+background 54M ✅ ✅ ✅
9999
inceptionv4 imagenet / imagenet+background 41M ✅ ✅ ✅
100-
efficientnet-b0 imagenet / advprop 4M ❌
101-
efficientnet-b1 imagenet / advprop 6M ❌
102-
efficientnet-b2 imagenet / advprop 7M ❌
103-
efficientnet-b3 imagenet / advprop 10M ❌
104-
efficientnet-b4 imagenet / advprop 17M ❌
105-
efficientnet-b5 imagenet / advprop 28M ❌
106-
efficientnet-b6 imagenet / advprop 40M ❌
107-
efficientnet-b7 imagenet / advprop 63M ❌
100+
efficientnet-b0 imagenet / advprop 4M ❌
101+
efficientnet-b1 imagenet / advprop 6M ❌
102+
efficientnet-b2 imagenet / advprop 7M ❌
103+
efficientnet-b3 imagenet / advprop 10M ❌
104+
efficientnet-b4 imagenet / advprop 17M ❌
105+
efficientnet-b5 imagenet / advprop 28M ❌
106+
efficientnet-b6 imagenet / advprop 40M ❌
107+
efficientnet-b7 imagenet / advprop 63M ❌
108108
mobilenet_v2 imagenet 2M ✅ ✅ ✅
109109
xception imagenet 20M ✅ ✅ ✅
110110
timm-efficientnet-b0 imagenet / advprop / noisy-student 4M ✅ ✅ ✅

segmentation_models_pytorch/encoders/efficientnet.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@
3535
class EfficientNetEncoder(EfficientNet, EncoderMixin):
3636
_is_torch_scriptable = False
3737

38-
# works with torch 2.4.0, but not with torch 2.5.1
39-
_is_torch_compilable = False
40-
4138
def __init__(
4239
self,
4340
stage_idxs: List[int],

tests/encoders/base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ def test_compile(self):
212212
encoder = self.get_tiny_encoder()
213213
encoder = encoder.eval().to(default_device)
214214

215+
torch.compiler.reset()
215216
compiled_encoder = torch.compile(encoder, fullgraph=True, dynamic=True)
216217

217218
if encoder._is_torch_compilable:

tests/models/base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,10 @@ def test_compile(self):
228228
self.skipTest("No diff and not on `main`.")
229229

230230
sample = self._get_sample().to(default_device)
231-
232231
model = self.get_default_model()
232+
model = model.eval().to(default_device)
233+
234+
torch.compiler.reset()
233235
compiled_model = torch.compile(model, fullgraph=True, dynamic=True)
234236

235237
with torch.inference_mode():

0 commit comments

Comments
 (0)