Add warning when cache_ram works with classify (#14650)
Co-authored-by: UltralyticsAssistant <web@ultralytics.com> Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
1c351b5036
commit
9df18ca9ef
1 changed files with 6 additions and 0 deletions
|
|
@ -431,6 +431,12 @@ class ClassificationDataset:
|
|||
self.samples = self.samples[: round(len(self.samples) * args.fraction)]
|
||||
self.prefix = colorstr(f"{prefix}: ") if prefix else ""
|
||||
self.cache_ram = args.cache is True or str(args.cache).lower() == "ram" # cache images into RAM
|
||||
if self.cache_ram:
|
||||
LOGGER.warning(
|
||||
"WARNING ⚠️ Classification `cache_ram` training has known memory leak in "
|
||||
"https://github.com/ultralytics/ultralytics/issues/9824, setting `cache_ram=False`."
|
||||
)
|
||||
self.cache_ram = False
|
||||
self.cache_disk = str(args.cache).lower() == "disk" # cache images on hard drive as uncompressed *.npy files
|
||||
self.samples = self.verify_images() # filter out bad images
|
||||
self.samples = [list(x) + [Path(x[0]).with_suffix(".npy"), None] for x in self.samples] # file, index, npy, im
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue