From 583ab82792ec09d56f298f139f4a840fa9ac287a Mon Sep 17 00:00:00 2001 From: DC Date: Thu, 3 Mar 2022 01:01:50 +0900 Subject: [PATCH] [Fix]: fix deadlock in multi-process evaluation (#52) * debug for issue #45 * push for lint --- mmrotate/datasets/dota.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mmrotate/datasets/dota.py b/mmrotate/datasets/dota.py index d05fb3f17..dac5df710 100644 --- a/mmrotate/datasets/dota.py +++ b/mmrotate/datasets/dota.py @@ -8,7 +8,7 @@ import zipfile from collections import defaultdict from functools import partial -from multiprocessing import Pool +from multiprocessing import get_context import mmcv import numpy as np @@ -380,7 +380,7 @@ def eval_map(det_results, area_ranges = ([(rg[0]**2, rg[1]**2) for rg in scale_ranges] if scale_ranges is not None else None) - pool = Pool(nproc) + pool = get_context('spawn').Pool(nproc) eval_results = [] for i in range(num_classes): # get gt and det bboxes of this class