# requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://huggingface.co/api/models/free21to9/ddpm-ema-flowers-64/preupload/main

**URL:** <https://discuss.huggingface.co/t/requests-exceptions-httperror-401-client-error-unauthorized-for-url-https-huggingface-co-api-models-free21to9-ddpm-ema-flowers-64-preupload-main/59820>\
**Category:** 🧨 Diffusers\
**Created:** [October 25, 2023, 8:36am UTC](https://discuss.huggingface.co/t/requests-exceptions-httperror-401-client-error-unauthorized-for-url-https-huggingface-co-api-models-free21to9-ddpm-ema-flowers-64-preupload-main/59820 "2023-10-25T08:36:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![free21to9](https://avatars.discourse-cdn.com/v4/letter/f/e495f1/32.png) [@free21to9](https://discuss.huggingface.co/u/free21to9)\
**Post date:** [October 25, 2023, 8:36am UTC](https://discuss.huggingface.co/t/requests-exceptions-httperror-401-client-error-unauthorized-for-url-https-huggingface-co-api-models-free21to9-ddpm-ema-flowers-64-preupload-main/59820/1 "2023-10-25T08:36:34Z")

</div>

When I run the diffusers/examples/dreambooth/train\_dreambooth.py via the following command:  
accelerate launch train\_unconditional.py   
–dataset\_name=“huggan/flowers-102-categories”   
–resolution=64   
–output\_dir=“ddpm-ema-flowers-64”   
–train\_batch\_size=16   
–num\_epochs=100   
–gradient\_accumulation\_steps=1   
–learning\_rate=1e-4   
–lr\_warmup\_steps=500   
–mixed\_precision=no   
–push\_to\_hub  
I got an error:  
Configuration saved in ddpm-ema-flowers-64/unet/config.json

Model weights saved in ddpm-ema-flowers-64/unet/diffusion\_pytorch\_model.safetensors

Configuration saved in ddpm-ema-flowers-64/scheduler/scheduler\_config.json

Configuration saved in ddpm-ema-flowers-64/model\_index.json

Traceback (most recent call last):

File “/opt/venv/lib/python3.8/site-packages/huggingface\_hub/utils/\_errors.py”, line 261, in hf\_raise\_for\_status

```
 response.raise_for_status()

```

File “/opt/venv/lib/python3.8/site-packages/requests/models.py”, line 1021, in raise\_for\_status

```
 raise HTTPError(http_error_msg, response=self)

```

requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: [https://huggingface.co/api/models/free21to9/ddpm-ema-flowers-64/preupload/main](https://huggingface.co/api/models/free21to9/ddpm-ema-flowers-64/preupload/main)

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

Traceback (most recent call last):

File “train\_unconditional.py”, line 706, in

```
 main(args)

```

File “train\_unconditional.py”, line 694, in main

```
 upload_folder(

```

File “/opt/venv/lib/python3.8/site-packages/huggingface\_hub/utils/\_validators.py”, line 118, in \_inner\_fn

```
 return fn(*args, **kwargs)

```

File “/opt/venv/lib/python3.8/site-packages/huggingface\_hub/hf\_api.py”, line 849, in \_inner

```
 return fn(self, *args, **kwargs)

```

File “/opt/venv/lib/python3.8/site-packages/huggingface\_hub/hf\_api.py”, line 3748, in upload\_folder

```
 commit_info = self.create_commit(

```

File “/opt/venv/lib/python3.8/site-packages/huggingface\_hub/utils/\_validators.py”, line 118, in \_inner\_fn

```
 return fn(*args, **kwargs)

```

File “/opt/venv/lib/python3.8/site-packages/huggingface\_hub/hf\_api.py”, line 849, in \_inner

```
 return fn(self, *args, **kwargs)

```

File “/opt/venv/lib/python3.8/site-packages/huggingface\_hub/hf\_api.py”, line 2914, in create\_commit

```
 upload_modes = fetch_upload_modes(

```

File “/opt/venv/lib/python3.8/site-packages/huggingface\_hub/utils/\_validators.py”, line 118, in \_inner\_fn

```
 return fn(*args, **kwargs)

```

File “/opt/venv/lib/python3.8/site-packages/huggingface\_hub/\_commit\_api.py”, line 482, in fetch\_upload\_modes

```
 hf_raise_for_status(resp)

```

File “/opt/venv/lib/python3.8/site-packages/huggingface\_hub/utils/\_errors.py”, line 293, in hf\_raise\_for\_status

```
 raise RepositoryNotFoundError(message, response) from e

```

huggingface\_hub.utils.\_errors.RepositoryNotFoundError: 401 Client Error. (Request ID: Root=1-6538c8bf-3f8ae8bc0a2c6f6876146985;2e31764d-4801-49c6-b193-97cb46a43848)

Repository Not Found for url: [https://huggingface.co/api/models/free21to9/ddpm-ema-flowers-64/preupload/main](https://huggingface.co/api/models/free21to9/ddpm-ema-flowers-64/preupload/main).

Please make sure you specified the correct `repo_id` and `repo_type`.

If you are trying to access a private or gated repo, make sure you are authenticated.

Invalid username or password.

Note: Creating a commit assumes that the repo already exists on the Huggingface Hub. Please use `create_repo` if it’s not the case.

Traceback (most recent call last):

File “/opt/venv/bin/accelerate”, line 8, in

```
 sys.exit(main())

```

File “/opt/venv/lib/python3.8/site-packages/accelerate/commands/accelerate\_cli.py”, line 47, in main

```
 args.func(args)

```

File “/opt/venv/lib/python3.8/site-packages/accelerate/commands/launch.py”, line 986, in launch\_command

```
 simple_launcher(args)

```

File “/opt/venv/lib/python3.8/site-packages/accelerate/commands/launch.py”, line 628, in simple\_launcher

```
 raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd)

```

subprocess.CalledProcessError: Command ‘[’/opt/venv/bin/python3’, ‘train\_unconditional.py’, ‘–dataset\_name=huggan/flowers-102-categories’, ‘–resolution=64’, ‘–output\_dir=ddpm-ema-flowers-64’, ‘–train\_batch\_size=16’, ‘–num\_epochs=100’, ‘–gradient\_accumulation\_steps=1’, ‘–learning\_rate=1e-4’, ‘–lr\_warmup\_steps=500’, ‘–mixed\_precision=no’, ‘–push\_to\_hub’]’ returned non-zero exit status 1.

anyone can hlep?
