genp / cocottributes

Code use to create COCO Attributes dataset and experiments in the associate ECCV 2016 paper.
46 stars 9 forks source link

How to load ./data/cocottributes_eccv_version.pkl? #7

Closed RookieHong closed 4 years ago

RookieHong commented 4 years ago

I tried to load it using pickle in Python 3.7, an error is raised when loading it using pickle.load:

Traceback (most recent call last):
  File "<input>", line 1, in <module>
UnicodeDecodeError: 'ascii' codec can't decode byte 0xf0 in position 726: ordinal not in range(128)

Then I tried with parameter encoding='iso-8859-1' and then another error is raised:

Traceback (most recent call last):
  File "<input>", line 1, in <module>
_pickle.UnpicklingError: unpickling stack underflow
AudreyBeard commented 4 years ago

Does this work?

    coco_attr_fpath = os.path.join(
        data_dir,
        'coco_attr/cocottributes_eccv_version.pkl'
    )
    with open(coco_attr_fpath, 'rb') as fid:
        attr_dset = pickle.load(fid, encoding='latin1')
RookieHong commented 4 years ago

It works, thanks!!