mirror of
https://github.com/open-mmlab/mmengine.git
synced 2025-06-03 21:54:44 +08:00
Fix resource package in windows (#308)
* move import resource * move import resource
This commit is contained in:
parent
4a4d6b1ab2
commit
bc763758d8
@ -3,7 +3,6 @@ import copy
|
|||||||
import os.path as osp
|
import os.path as osp
|
||||||
import platform
|
import platform
|
||||||
import random
|
import random
|
||||||
import resource
|
|
||||||
import time
|
import time
|
||||||
import warnings
|
import warnings
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
@ -634,6 +633,7 @@ class Runner:
|
|||||||
# https://github.com/pytorch/pytorch/issues/973
|
# https://github.com/pytorch/pytorch/issues/973
|
||||||
# set resource limit
|
# set resource limit
|
||||||
if platform.system() != 'Windows':
|
if platform.system() != 'Windows':
|
||||||
|
import resource
|
||||||
rlimit = resource.getrlimit(resource.RLIMIT_NOFILE)
|
rlimit = resource.getrlimit(resource.RLIMIT_NOFILE)
|
||||||
base_soft_limit = rlimit[0]
|
base_soft_limit = rlimit[0]
|
||||||
hard_limit = rlimit[1]
|
hard_limit = rlimit[1]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user