In cocoapi:
File "/home/chenwy/.virtualenvs/torch1.4_py3/lib/python3.6/site-packages/pycocotools/coco.py", line 308, in loadRes
if type(resFile) == str or type(resFile) == unicode:
NameError: name 'unicode' is not defined
Python 3 renamed the unicode type to str, the old str type has been replaced by bytes.
if isinstance(unicode_or_str, str):
text = unicode_or_str
decoded = False
else:
text = unicode_or_str.decode(encoding)
decoded = True