renmengye / few-shot-ssl-public

Meta Learning for Semi-Supervised Few-Shot Classification
Other
552 stars 100 forks source link

Data Format in tiered imagenet #4

Closed ylfzr closed 6 years ago

ylfzr commented 6 years ago

Hi, Thankyou for sharing the code and data. I have a question about the tieredImagenet data. When I loaded the .pkl file, I found the data was a list of numpy array. But the array is not of the shape (img_size img_size 3) and can't not be reshaped into this form. A numpy array should be a image right? Besides, I find that the shape of images change, from near 8000 to near 19000?

ylfzr commented 6 years ago

I sloved this using cv2.imdecode().

Sorry for bothering

renmengye commented 6 years ago

Hi, Sorry for the late response. I included a script in the repo for decompress the PNG data.

lxxue commented 5 years ago

I made two minor modifications to successfully load the tiered imagenet and reproduce baseline experiments.

  1. in decompress function: array = pkl.load(f) should be loaded in bytes array = pkl.load(f, encoding='bytes')
  2. in read_cache function: self._label_str = self._label_specific_str self._labels = self._label_specific should be unindented so that these two lines are in the same level of try-except block above.

Please correct me if I am wrong. Thanks in advance!