Pip debug fixes (#139)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Glenn Jocher 2023-01-03 18:54:44 +01:00 committed by GitHub
parent 340376f7a6
commit d74de2582c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 37 additions and 37 deletions

View file

@ -213,9 +213,8 @@ class YOLO:
@smart_inference_mode()
def __call__(self, imgs):
if not self.model:
LOGGER.info("model not initialized!")
return self.model(imgs)
device = next(self.model.parameters()).device # get model device
return self.model(imgs.to(device))
def forward(self, imgs):
return self.__call__(imgs)