if len(imgIds) == len(catIds) == 0:
ids = self.imgs.keys()
else:
ids = set(imgIds)
for i, catId in enumerate(catIds):
if i == 0 and len(ids) == 0:
ids = set(self.catToImgs[catId])
else:
197 -> ids &= set(self.catToImgs[catId])
In my annotations.json, the codes this line makes ids an empty list object. However,when i changed to ids |= set(self.catToImgs[catId]) ,everything was ok !! So i think some other situation should be included.
and coco.py import matplotlib; matplotlib.use('TkAgg') repair UserWarning: Matplotlib is currently using agg,which is a non-GUI backend, so cannot show the figure
if len(imgIds) == len(catIds) == 0: ids = self.imgs.keys() else: ids = set(imgIds) for i, catId in enumerate(catIds): if i == 0 and len(ids) == 0: ids = set(self.catToImgs[catId]) else: 197 -> ids &= set(self.catToImgs[catId]) In my annotations.json, the codes this line makes ids an empty list object. However,when i changed to ids |= set(self.catToImgs[catId]) ,everything was ok !! So i think some other situation should be included.