Skip to content

What is the meta.bin file used by the ImageNet dataset? #1646

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pmeier opened this issue Dec 7, 2019 · 5 comments
Closed

What is the meta.bin file used by the ImageNet dataset? #1646

pmeier opened this issue Dec 7, 2019 · 5 comments

Comments

@pmeier
Copy link
Collaborator

pmeier commented Dec 7, 2019

Comment from @kanonjz in #1457

I downloaded imagenet myself and used parse_val_archive to prepare the folders, but got an error below. What is the meta.bin? I didn't find it in the imagenet.

The meta file meta.bin is not present in the root directory or is corrupted. " "This file is automatically created by the ImageNet dataset.

@pmeier
Copy link
Collaborator Author

pmeier commented Dec 7, 2019

meta.bin is a binary file which holds 2 things:

  1. A dict with a mapping from the WordNet IDs (wnids) to human-readable classes.
  2. A list of the wnid of each validation image.

The meta.bin file is created by executing the parse_devkit_archive function:

def parse_devkit_archive(root, file=None):
"""Parse the devkit archive of the ImageNet2012 classification dataset and save
the meta information in a binary file.
Args:
root (str): Root directory containing the devkit archive
file (str, optional): Name of devkit archive. Defaults to
'ILSVRC2012_devkit_t12.tar.gz'
"""

Note that this requires scipy to be installed.


@kanonjz To resolve your error you have 2 options:

  1. Download the devkit archive and parse it with the function mentioned above to generate the meta.bin file.
  2. The parse_val_archive function only tries to load the wnids from the meta.bin file if none are given to it. If you have a list, try passing it like this:
parse_val_archive(..., wnids=my_wnid_list)

@kanonjz
Copy link

kanonjz commented Dec 8, 2019

Thanks!!

@pmeier
Copy link
Collaborator Author

pmeier commented Dec 8, 2019

@kanonjz Is your problem resolved? If yes, I'm going to close this issue.

@kanonjz
Copy link

kanonjz commented Dec 8, 2019

@pmeier Yes!

@fmassa
Copy link
Member

fmassa commented Dec 10, 2019

Thanks @pmeier for helping out with this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants