Skip to content

Commit e2ce2e2

Browse files
authored
update resource limit (open-mmlab#700)
1 parent 75eac77 commit e2ce2e2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mmseg/datasets/builder.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
# https://github.com/pytorch/pytorch/issues/973
1515
import resource
1616
rlimit = resource.getrlimit(resource.RLIMIT_NOFILE)
17+
base_soft_limit = rlimit[0]
1718
hard_limit = rlimit[1]
18-
soft_limit = min(4096, hard_limit)
19+
soft_limit = min(max(4096, base_soft_limit), hard_limit)
1920
resource.setrlimit(resource.RLIMIT_NOFILE, (soft_limit, hard_limit))
2021

2122
DATASETS = Registry('dataset')

0 commit comments

Comments
 (0)