Skip to content

Commit b873f28

Browse files
committed
WAR: Disabling ViT tests until exporting with py311 is fixed
More info: huggingface/pytorch-image-models#1946 Signed-off-by: Naren Dasan <[email protected]> Signed-off-by: Naren Dasan <[email protected]>
1 parent 3b0e6c0 commit b873f28

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

tests/cpp/test_compiled_modules.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ INSTANTIATE_TEST_SUITE_P(
5959
PathAndInput({"tests/modules/mobilenet_v2_scripted.jit.pt", {{1, 3, 224, 224}}, {at::kFloat}}),
6060
PathAndInput({"tests/modules/efficientnet_b0_scripted.jit.pt", {{1, 3, 224, 224}}, {at::kFloat}}),
6161
PathAndInput({"tests/modules/bert_base_uncased_traced.jit.pt", {{1, 14}, {1, 14}}, {at::kInt, at::kInt}}),
62-
PathAndInput({"tests/modules/vit_scripted.jit.pt", {{1, 3, 224, 224}}, {at::kFloat}})));
62+
// NOTE: ViT tests are disabled until Python 3.11 issue is resolved
63+
// https://github.com/huggingface/pytorch-image-models/issues/1946 PathAndInput({"tests/modules/vit_scripted.jit.pt",
64+
// {{1, 3, 224, 224}}, {at::kFloat}})));
6365

6466
#endif

tests/cpp/test_modules_as_engines.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,7 @@ INSTANTIATE_TEST_SUITE_P(
3030
PathAndInput({"tests/modules/resnet18_scripted.jit.pt", {{1, 3, 224, 224}}, {at::kFloat}}),
3131
PathAndInput({"tests/modules/mobilenet_v2_scripted.jit.pt", {{1, 3, 224, 224}}, {at::kFloat}}),
3232
PathAndInput({"tests/modules/efficientnet_b0_scripted.jit.pt", {{1, 3, 224, 224}}, {at::kFloat}}),
33-
PathAndInput({"tests/modules/vit_scripted.jit.pt", {{1, 3, 224, 224}}, {at::kFloat}})));
33+
// NOTE: ViT tests are disabled until Python 3.11 issue is resolved
34+
// https://github.com/huggingface/pytorch-image-models/issues/1946 PathAndInput({"tests/modules/vit_scripted.jit.pt",
35+
// {{1, 3, 224, 224}}, {at::kFloat}})));
3436
#endif

tests/modules/hub.py

+11-9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1+
import json
2+
import os
3+
4+
import custom_models as cm
5+
import timm
16
import torch
27
import torch.nn as nn
38
import torch.nn.functional as F
49
import torchvision.models as models
5-
import timm
6-
from transformers import BertModel, BertTokenizer, BertConfig
7-
import os
8-
import json
9-
import custom_models as cm
10+
from transformers import BertConfig, BertModel, BertTokenizer
1011

1112
torch.hub._validate_not_a_forked_repo = lambda a, b, c: True
1213

@@ -50,10 +51,11 @@
5051
"model": timm.create_model("efficientnet_b0", pretrained=True),
5152
"path": "script",
5253
},
53-
"vit": {
54-
"model": timm.create_model("vit_base_patch16_224", pretrained=True),
55-
"path": "script",
56-
},
54+
# NOTE: Disabling ViT until support in 3.11 is fixed https://github.com/huggingface/pytorch-image-models/issues/1946
55+
# "vit": {
56+
# "model": timm.create_model("vit_base_patch16_224", pretrained=True),
57+
# "path": "script",
58+
# },
5759
"pooling": {"model": cm.Pool(), "path": "trace"},
5860
"module_fallback": {"model": cm.ModuleFallbackMain(), "path": "script"},
5961
"loop_fallback_eval": {"model": cm.LoopFallbackEval(), "path": "script"},

0 commit comments

Comments
 (0)