Skip to content
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

Fixed the broken devkit link #944

Merged
merged 4 commits into from
Mar 28, 2023
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 14 additions & 16 deletions pl_bolts/datamodules/imagenet_datamodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,22 +126,20 @@ def prepare_data(self) -> None:
for split in ["train", "val"]:
files = os.listdir(os.path.join(self.data_dir, split))
if "meta.bin" not in files:
raise FileNotFoundError(
"""
no meta.bin present. Imagenet is no longer automatically downloaded by PyTorch.
To get imagenet:
1. download yourself from http://www.image-net.org/challenges/LSVRC/2012/downloads
2. download the devkit (ILSVRC2012_devkit_t12.tar.gz)
3. generate the meta.bin file using the devkit
4. copy the meta.bin file into both train and val split folders

To generate the meta.bin do the following:

from pl_bolts.datasets import UnlabeledImagenet
path = '/path/to/folder/with/ILSVRC2012_devkit_t12.tar.gz/'
UnlabeledImagenet.generate_meta_bins(path)
"""
)
raise FileNotFoundError("""
no meta.bin present. Imagenet is no longer automatically downloaded by PyTorch.
To get imagenet:

1. download the devkit (https://image-net.org/data/ILSVRC/2012/ILSVRC2012_devkit_t12.tar.gz)
2. generate the meta.bin file using the devkit
3. copy the meta.bin file into both train and val split folders

To generate the meta.bin do the following:

from pl_bolts.datasets import UnlabeledImagenet
path = '/path/to/folder/with/ILSVRC2012_devkit_t12.tar.gz/'
UnlabeledImagenet.generate_meta_bins(path)
""")

def train_dataloader(self) -> DataLoader:
"""Uses the train split of imagenet2012 and puts away a portion of it for the validation split."""
Expand Down