Skip to content

Commit dbb4efb

Browse files
authored
fix(coco): fix Nonetype error when evaluating (Megvii-BaseDetection#1581)
1 parent 16d5a5f commit dbb4efb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

yolox/data/datasets/coco.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def _cache_images(self):
9999
f"there is no guarantee that the remaining memory space is sufficient"
100100
)
101101

102-
if self.cache and self.imgs is None:
102+
if self.imgs is None:
103103
if self.cache_type == 'ram':
104104
self.imgs = [None] * self.num_imgs
105105
logger.info("You are using cached images in RAM to accelerate training!")
@@ -224,9 +224,9 @@ def pull_item(self, index):
224224
id_ = self.ids[index]
225225
label, origin_image_size, _, filename = self.annotations[index]
226226

227-
if self.cache_type == 'ram':
227+
if self.cache and self.cache_type == 'ram':
228228
img = self.imgs[index]
229-
elif self.cache_type == 'disk':
229+
elif self.cache and self.cache_type == 'disk':
230230
img = np.load(os.path.join(self.cache_dir, f"{filename.split('.')[0]}.npy"))
231231
else:
232232
img = self.load_resized_img(index)

0 commit comments

Comments
 (0)