From 605e7f4f52709b12ca6044184364201b186d66d7 Mon Sep 17 00:00:00 2001 From: Laughing <61612323+Laughing-q@users.noreply.github.com> Date: Mon, 17 Jun 2024 21:18:19 +0800 Subject: [PATCH] Clean up unused `Silence` module (#13674) --- ultralytics/cfg/models/v9/yolov9e-seg.yaml | 2 +- ultralytics/cfg/models/v9/yolov9e.yaml | 2 +- ultralytics/nn/modules/__init__.py | 2 -- ultralytics/nn/tasks.py | 1 - 4 files changed, 2 insertions(+), 5 deletions(-) diff --git a/ultralytics/cfg/models/v9/yolov9e-seg.yaml b/ultralytics/cfg/models/v9/yolov9e-seg.yaml index 7a72b29fe4b..23f616b19e2 100644 --- a/ultralytics/cfg/models/v9/yolov9e-seg.yaml +++ b/ultralytics/cfg/models/v9/yolov9e-seg.yaml @@ -7,7 +7,7 @@ nc: 80 # number of classes # gelan backbone backbone: - - [-1, 1, Silence, []] + - [-1, 1, nn.Identity, []] - [-1, 1, Conv, [64, 3, 2]] # 1-P1/2 - [-1, 1, Conv, [128, 3, 2]] # 2-P2/4 - [-1, 1, RepNCSPELAN4, [256, 128, 64, 2]] # 3 diff --git a/ultralytics/cfg/models/v9/yolov9e.yaml b/ultralytics/cfg/models/v9/yolov9e.yaml index b05a5ff49e7..c2ddfb46235 100644 --- a/ultralytics/cfg/models/v9/yolov9e.yaml +++ b/ultralytics/cfg/models/v9/yolov9e.yaml @@ -7,7 +7,7 @@ nc: 80 # number of classes # gelan backbone backbone: - - [-1, 1, Silence, []] + - [-1, 1, nn.Identity, []] - [-1, 1, Conv, [64, 3, 2]] # 1-P1/2 - [-1, 1, Conv, [128, 3, 2]] # 2-P2/4 - [-1, 1, RepNCSPELAN4, [256, 128, 64, 2]] # 3 diff --git a/ultralytics/nn/modules/__init__.py b/ultralytics/nn/modules/__init__.py index 54f87fdea46..1b1fe5f6629 100644 --- a/ultralytics/nn/modules/__init__.py +++ b/ultralytics/nn/modules/__init__.py @@ -45,7 +45,6 @@ RepC3, RepNCSPELAN4, ResNetLayer, - Silence, ) from .conv import ( CBAM, @@ -134,5 +133,4 @@ "SPPELAN", "CBFuse", "CBLinear", - "Silence", ) diff --git a/ultralytics/nn/tasks.py b/ultralytics/nn/tasks.py index ae241177ba3..020f873bf18 100644 --- a/ultralytics/nn/tasks.py +++ b/ultralytics/nn/tasks.py @@ -47,7 +47,6 @@ ResNetLayer, RTDETRDecoder, Segment, - Silence, # noqa (equivalent to nn.Identity, unused in file but required to load YOLOv9 models) WorldDetect, ) from ultralytics.utils import DEFAULT_CFG_DICT, DEFAULT_CFG_KEYS, LOGGER, colorstr, emojis, yaml_load