# Pushing dataset images to Hub

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpushing-dataset-images-to-hub%2F23693%3E%5C
**Category:** 🤗Datasets\
**Created:** [September 27, 2022, 7:10pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpushing-dataset-images-to-hub%2F23693 "2022-09-27T19:10:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MHamdan](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/mhamdan/32/61595_2.png) [@MHamdan](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FMHamdan)%5C
**Post date:** [September 27, 2022, 7:10pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpushing-dataset-images-to-hub%2F23693%2F1 "2022-09-27T19:10:23Z")

</div>

Hello all,  
As I am new using HugginFace, I hope anyone can help me out on how to push the dataset to hub. here is code \>\>

```auto
from datasets import load_dataset

# first: load dataset
# option 1: from local folder
#dataset = load_dataset("imagefolder", data_dir="./datasets")#, use_auth_token=True)
# option 2: from remote URL (e.g. a zip file)
dataset = load_dataset("imagefolder", data_files="https://data.deepai.org/mnist.zip")

# next: push to the hub (assuming git-LFS is installed)
dataset.push_to_hub("huggan/Portion-IAM-form-A-D")

```

FYI, I tried both ways, I have some images in folder `datasets` Also, I tried from my `Drive with write mode`, Unfortunately, I ended up with the same following error:…

- HTTPError: 403 Client Error: Forbidden for url: [https://huggingface.co/api/repos/create](https://huggingface.co/api/repos/create) (Request ID: SuDy7vKu-xM8klH9RoWEj) - You don’t have the rights to create a dataset under this namespace

---

<div class="post-metadata">

**Author:** ![mariosasko](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/mariosasko/32/31548_2.png) [@mariosasko](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fmariosasko)%5C
**Post date:** [September 28, 2022, 2:01pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpushing-dataset-images-to-hub%2F23693%2F2 "2022-09-28T14:01:26Z")

</div>

Hi! From what I see, you are not a member of the `huggan` organization on the Hub, so you are not allowed to push the dataset there. Instead, you can push it to your own namespace (which is your username), but make sure to log in with `huggingface-cli login` before that to avoid the `403 Forbidden` error.

---

<div class="post-metadata">

**Author:** ![vidhikatkoria](https://avatars.discourse-cdn.com/v4/letter/v/b782af/32.png) [@vidhikatkoria](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fvidhikatkoria)%5C
**Post date:** [October 21, 2022, 8:01am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpushing-dataset-images-to-hub%2F23693%2F3 "2022-10-21T08:01:08Z")

</div>

Hi, I got the same error for uploading the dataset to my personal namespace.  
I am pushing to hub from google colab notebook.

```auto
!huggingface-cli login
Token: 
Login successful
Your token has been saved to /root/.huggingface/token

dataset.push_to_hub("vidhikatkoria/FewShotSGD")

WARNING:datasets.dataset_dict:Pushing split train to the Hub.

---------------------------------------------------------------------------

HTTPError Traceback (most recent call last)

/usr/local/lib/python3.7/dist-packages/huggingface_hub/utils/_errors.py in hf_raise_for_status(response, endpoint_name)
    212 try:
--> 213 response.raise_for_status()
    214 except HTTPError as e:

9 frames

HTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/repos/create

The above exception was the direct cause of the following exception:

HfHubHTTPError Traceback (most recent call last)

/usr/local/lib/python3.7/dist-packages/huggingface_hub/utils/_errors.py in hf_raise_for_status(response, endpoint_name)
    252 # Convert `HTTPError` into a `HfHubHTTPError` to display request information
    253 # as well (request id and/or server error message)
--> 254 raise HfHubHTTPError(str(HTTPError), response=response) from e
    255 
    256 

HfHubHTTPError: <class 'requests.exceptions.HTTPError'> (Request ID: VQk_ZYyQMAixbL97CSPSY)

You don't have the rights to create a dataset under this namespace - You don't have the rights to create a dataset under this namespace

```

I don’t understand what I could be doing wrong

---

<div class="post-metadata">

**Author:** ![nielsr](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/nielsr/32/39617_2.png) [@nielsr](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fnielsr)%5C
**Post date:** [October 21, 2022, 9:48am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpushing-dataset-images-to-hub%2F23693%2F4 "2022-10-21T09:48:56Z")

</div>

Seems like you’ve successfully pushed it: [https://huggingface.co/datasets/vidhikatkoria/FewShotSGD](https://huggingface.co/datasets/vidhikatkoria/FewShotSGD)

So everything’s working fine now?

---

<div class="post-metadata">

**Author:** ![vidhikatkoria](https://avatars.discourse-cdn.com/v4/letter/v/b782af/32.png) [@vidhikatkoria](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fvidhikatkoria)%5C
**Post date:** [October 25, 2022, 6:18pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpushing-dataset-images-to-hub%2F23693%2F5 "2022-10-25T18:18:43Z")

</div>

Yes, I was using a read only token while running the push to hub command. Thanks for your reply though. Appreciate it.
