pull/8571/head
Laughing 9 months ago committed by GitHub
parent 5d87d28178
commit d287d55b51
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      ultralytics/engine/exporter.py
  2. 2
      ultralytics/nn/tasks.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"

@ -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):

Loading…
Cancel
Save