Skip to content

Commit

Permalink
[TorchFX] Test implementation of YoloV8 is removed (#2858)
Browse files Browse the repository at this point in the history
### Changes

Test implementation of YoloV8 is removed from tests models

### Reason for changes

To align with latest ultralytics models
  • Loading branch information
daniil-lyakhov authored Jul 31, 2024
1 parent 80c612e commit 655f296
Show file tree
Hide file tree
Showing 9 changed files with 191 additions and 2,140 deletions.

Large diffs are not rendered by default.

366 changes: 183 additions & 183 deletions tests/torch/data/reference_graphs/fx/yolov8n.dot

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions tests/torch/fx/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import torch.utils.data.distributed
import torchvision.models as models
from torch._export import capture_pre_autograd_graph
from ultralytics.models.yolo import YOLO

from nncf.common.graph.graph import NNCFNodeName
from nncf.common.graph.operator_metatypes import OperatorMetatype
Expand All @@ -35,7 +36,6 @@
from nncf.torch.dynamic_graph.patch_pytorch import disable_patching
from tests.shared.paths import TEST_ROOT
from tests.torch.test_compressed_graph import check_graph
from tests.torch.test_models.yolov8.model import YoloV8Model

FX_DIR_NAME = "fx"

Expand All @@ -54,9 +54,12 @@ def torchvision_model_case(model_id: str, input_shape: Tuple[int,]):

def yolo_v8_case(model_id, input_shape):
def get_model() -> torch.nn.Module:
model = YoloV8Model().eval()
model_config = model_id + ".yaml"
model = YOLO(model_config)
model = model.model
model.eval()
# Warmup model
model(torch.empty(input_shape))
model(torch.ones(input_shape))
return model

return ModelCase(get_model, model_id, input_shape)
Expand Down
1 change: 1 addition & 0 deletions tests/torch/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ timm==0.9.2
# Required for torch/fx tests
torchvision
fastdownload==0.0.7
ultralytics==8.2.56
Loading

0 comments on commit 655f296

Please sign in to comment.