Imagenet-1k is not available in huggingface dataset hub

I have tried using imagenet-1k on streaming mode using the following code, but it failed and the error is also attached please help me resolve this issue.

from datasets import load_dataset
from datasets.utils.file_utils import get_datasets_user_agent

print("Creating dataset")


def example_usage():
    dset = load_dataset('imagenet-1k', split='train', streaming=True)
    # print(tiny_imagenet[0])
    print(next(iter(dset)))


if __name__ == '__main__':
    example_usage()

This is the error I am getting.

Hihi!

imagenet-1k is a gated dataset which means you’ll have to agree to share your contact info to access it. Have you tried this yet? Once you have, you can sign in with your user token (you can find this in your Hugging Face account settings) when prompted by running:

huggingface-cli login

Then use your token when you load the dataset:

from datasets import load_dataset

dset = load_dataset('imagenet-1k', split='train', streaming=True, use_auth_token=True)
2 Likes

Thank you it actually worked.

2 Likes

Can you suggest how to use imagenet-1k in a batchwise fashion?