Cannot download the dataset from the dataset library

#5
by AzzamRadman - opened

When trying to download the dataset into a Kaggle kernel using the following code:

from datasets import load_dataset
ds = load_dataset('competitions/aiornot')

I get this error:

`RepositoryNotFoundError: 401 Client Error. (Request ID: Root=1-63d6b793-2caefce4285fcba82f91c4f3)

Repository Not Found for url: https://huggingface.co/api/datasets/competitions/aiornot.
Please make sure you specified the correct repo_id and repo_type.
If the repo is private, make sure you are authenticated.
Invalid username or password.`

What could be done in this case?

@AzzamRadman , at first you have to get your user access token. Then do the following.

from datasets import load_dataset

access_token = "hf_..."      # Your access token. YOU MUST KEEP IT A SECRET!

data_files = {'train': ['train.zip', 'train.csv'], 'test': 'test.zip'}
dataset = load_dataset('competitions/aiornot',
                       use_auth_token=access_token,
                       data_files=data_files)

Hi, just as a checkup in case I'm doing something wrong: after loading the dataset as above, then if we just print the dataset, there are more test images than train:

DatasetDict({
    train: Dataset({
        features: ['image', 'label'],
        num_rows: 18618
    })
    test: Dataset({
        features: ['image', 'label'],
        num_rows: 43442
    })
})

Furthermore, if we print the first one of each just to see the output, we get:

print(dataset['train'][0])  # {'image': <PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=512x512>,  'label': None}
print(dataset['test'][0])  # {'image': <PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=512x512>,  'label': 0}

As a matter of fact, all of the labels are None or 0 for train and test, respectively.

Am I missing something here? Sorry, this is my first time using huggingfaces datasets, so maybe the easiest solution is to download the files and using them 'as usual'.

The train dataset has 0 and 1 labels. The test dataset had labels as -1 for all images.

Sign up or log in to comment