t = ""
self._filename = osp.abspath(osp.expanduser(save_prefix) + t + ".json")
try:
f = open(self._filename, "w")
except IOError as e:
raise RuntimeError("Unable to open json file to dump. What(): {}".format(str(e)))
else:
f.close()
After Change
except IOError as e:
raise RuntimeError("Unable to dump json file, ignored. What(): {}".format(str(e)))
pred = self.dataset.coco.loadRes(self._filename)
gt = self.dataset.coco
// lazy import pycocotools
try_import_pycocotools()