Skip to content

Commit

Permalink
NUM_THREADS leave at least 1 CPU free (#5706)
Browse files Browse the repository at this point in the history
Updated strategy leaves at least 1 cpu free to avoid system overloads. Partially addresses #5685
  • Loading branch information
glenn-jocher authored Nov 18, 2021
1 parent 562191f commit 8df64a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
IMG_FORMATS = ['bmp', 'jpg', 'jpeg', 'png', 'tif', 'tiff', 'dng', 'webp', 'mpo'] # acceptable image suffixes
VID_FORMATS = ['mov', 'avi', 'mp4', 'mpg', 'mpeg', 'm4v', 'wmv', 'mkv'] # acceptable video suffixes
WORLD_SIZE = int(os.getenv('WORLD_SIZE', 1)) # DPP
NUM_THREADS = min(8, os.cpu_count()) # number of multiprocessing threads
NUM_THREADS = min(8, max(1, os.cpu_count() - 1)) # number of multiprocessing threads

# Get orientation exif tag
for orientation in ExifTags.TAGS.keys():
Expand Down

0 comments on commit 8df64a9

Please sign in to comment.