diff --git a/PythonAPI/pycocotools/coco.py b/PythonAPI/pycocotools/coco.py index dc9972baf44648889ef1bd9fbf3a0d37c098ebe3..b8e913bc160be445082f5225d94cd8954d33b0f2 100644 --- a/PythonAPI/pycocotools/coco.py +++ b/PythonAPI/pycocotools/coco.py @@ -305,7 +305,7 @@ class COCO: print('Loading and preparing results...') tic = time.time() - if type(resFile) == str or type(resFile) == unicode: + if type(resFile) == str or (PYTHON_VERSION == 2 and type(resFile) == unicode): anns = json.load(open(resFile)) elif type(resFile) == np.ndarray: anns = self.loadNumpyAnnotations(resFile)