fix windows ms

This commit is contained in:
littletomatodonkey 2020-07-30 02:00:25 +00:00
parent 62147ec9c6
commit 14fdead9ab
2 changed files with 2 additions and 2 deletions

View File

@ -43,7 +43,7 @@ class TrainReader(object):
img_num = len(label_infor_list) img_num = len(label_infor_list)
img_id_list = list(range(img_num)) img_id_list = list(range(img_num))
random.shuffle(img_id_list) random.shuffle(img_id_list)
if sys.platform == "win32": if sys.platform == "win32" and self.num_workers != 1:
print("multiprocess is not fully compatible with Windows." print("multiprocess is not fully compatible with Windows."
"num_workers will be 1.") "num_workers will be 1.")
self.num_workers = 1 self.num_workers = 1

View File

@ -233,7 +233,7 @@ class SimpleReader(object):
img_num = len(label_infor_list) img_num = len(label_infor_list)
img_id_list = list(range(img_num)) img_id_list = list(range(img_num))
random.shuffle(img_id_list) random.shuffle(img_id_list)
if sys.platform == "win32": if sys.platform == "win32" and self.num_workers != 1:
print("multiprocess is not fully compatible with Windows." print("multiprocess is not fully compatible with Windows."
"num_workers will be 1.") "num_workers will be 1.")
self.num_workers = 1 self.num_workers = 1