ultralytics 8.3.62 Fix non-deterministic transforms with albumentations>=1.4.21 (#18701)
Signed-off-by: Mohammed Yasin <32206511+Y-T-G@users.noreply.github.com> Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com> Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
5a58950a7c
commit
d9292fb7f1
2 changed files with 4 additions and 1 deletions
|
|
@ -1860,6 +1860,9 @@ class Albumentations:
|
|||
if self.contains_spatial
|
||||
else A.Compose(T)
|
||||
)
|
||||
if hasattr(self.transform, "set_random_seed"):
|
||||
# Required for deterministic transforms in albumentations>=1.4.21
|
||||
self.transform.set_random_seed(torch.initial_seed())
|
||||
LOGGER.info(prefix + ", ".join(f"{x}".replace("always_apply=False, ", "") for x in T if x.p))
|
||||
except ImportError: # package not installed, skip
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue