Skip to content

Name 'unicode' is not defined in Python 3 #49

Open
@waleedka

Description

@waleedka

I'm getting this error when I call loadRes() with Python 3.5. Python 3 replaced unicode with str.

coco_results = coco_val.loadRes(results)

This is the stack trace:

/usr/local/lib/python3.5/dist-packages/pycocotools/coco.py in loadRes(self, resFile)
    301         print('Loading and preparing results...')
    302         tic = time.time()
--> 303         if type(resFile) == str or type(resFile) == unicode:
    304             anns = json.load(open(resFile))
    305         elif type(resFile) == np.ndarray:

NameError: name 'unicode' is not defined

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions