From d287d55b51c9264af249bb2212bf95f3528566b5 Mon Sep 17 00:00:00 2001 From: Laughing <61612323+Laughing-q@users.noreply.github.com> Date: Mon, 4 Mar 2024 12:38:36 +0800 Subject: [PATCH] Clean up (#8623) --- ultralytics/engine/exporter.py | 1 - ultralytics/nn/tasks.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/ultralytics/engine/exporter.py b/ultralytics/engine/exporter.py index 173983e21..fd3aea3af 100644 --- a/ultralytics/engine/exporter.py +++ b/ultralytics/engine/exporter.py @@ -201,7 +201,6 @@ class Exporter: assert self.device.type == "cpu", "optimize=True not compatible with cuda devices, i.e. use device='cpu'" if edgetpu and not LINUX: raise SystemError("Edge TPU export only supported on Linux. See https://coral.ai/docs/edgetpu/compiler/") - print(type(model)) if isinstance(model, WorldModel): LOGGER.warning( "WARNING ⚠️ YOLOWorld (original version) export is not supported to any format.\n" diff --git a/ultralytics/nn/tasks.py b/ultralytics/nn/tasks.py index e7017597a..64ee7f503 100644 --- a/ultralytics/nn/tasks.py +++ b/ultralytics/nn/tasks.py @@ -576,7 +576,7 @@ class WorldModel(DetectionModel): text_token = clip.tokenize(text).to(device) txt_feats = model.encode_text(text_token).to(dtype=torch.float32) txt_feats = txt_feats / txt_feats.norm(p=2, dim=-1, keepdim=True) - self.txt_feats = txt_feats.reshape(-1, len(text), txt_feats.shape[-1]) + self.txt_feats = txt_feats.reshape(-1, len(text), txt_feats.shape[-1]).detach() self.model[-1].nc = len(text) def init_criterion(self):