ultralytics 8.2.78 fix DDP training with pretrained weights (#15616)

Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
Laughing 2024-08-16 04:04:46 +08:00 committed by GitHub
parent 0635a40b98
commit a6f4a9f2d4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 740 additions and 732 deletions

View file

@ -381,6 +381,7 @@ class Model(nn.Module):
"""
self._check_is_pytorch_model()
if isinstance(weights, (str, Path)):
self.overrides["pretrained"] = weights # remember the weights for DDP training
weights, self.ckpt = attempt_load_one_weight(weights)
self.model.load(weights)
return self