huggingface/deep-rl-class

[HANDS-ON BUG] Unit 6

dbailleul opened this issue · 2 comments

Hello everybody!

I used Google Colab from my personal space as recommanded.
I did not change a thing from the script as expected.

I have a problem when I tried pushing the agent at the end of the Unit 6 hands-on:

from huggingface_sb3 import package_to_hub

package_to_hub(
    model=model,
    model_name=f"a2c-{env_id}",
    model_architecture="A2C",
    env_id=env_id,
    eval_env=eval_env,
    repo_id=f"ThomasSimonini/a2c-{env_id}", # Change the username
    commit_message="Initial commit",
)

I've got a whole error message:

This function will save, evaluate, generate a video of your agent,
create a model card and push everything to the hub. It might take up to 1min.
This is a work in progress: if you encounter a bug, please open an issue.
Saving video to /tmp/tmpotrksyum/-step-0-to-step-1000.mp4
Moviepy - Building video /tmp/tmpotrksyum/-step-0-to-step-1000.mp4.
Moviepy - Writing video /tmp/tmpotrksyum/-step-0-to-step-1000.mp4

Moviepy - Done !
Moviepy - video ready /tmp/tmpotrksyum/-step-0-to-step-1000.mp4
ℹ Pushing repo ThomasSimonini/a2c-PandaReachDense-v3 to the Hugging
Face Hub

a2c-PandaReachDense-v3.zip: 100%
110k/110k [00:01<00:00, 110kB/s]
vec_normalize.pkl: 100%
2.82k/2.82k [00:01<00:00, 3.28kB/s]
Upload 2 LFS files: 100%
2/2 [00:02<00:00, 2.06s/it]

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

HTTPError                                 Traceback (most recent call last)

[/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_errors.py](https://localhost:8080/#) in hf_raise_for_status(response, endpoint_name)
    269     try:
--> 270         response.raise_for_status()
    271     except HTTPError as e:

9 frames

HTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/models/ThomasSimonini/a2c-PandaReachDense-v3/commit/main


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

HfHubHTTPError                            Traceback (most recent call last)

[/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_errors.py](https://localhost:8080/#) in hf_raise_for_status(response, endpoint_name)
    328         # Convert `HTTPError` into a `HfHubHTTPError` to display request information
    329         # as well (request id and/or server error message)
--> 330         raise HfHubHTTPError(str(e), response=response) from e
    331 
    332 

HfHubHTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/models/ThomasSimonini/a2c-PandaReachDense-v3/commit/main (Request ID: Root=1-6564709f-2eff96c901f3b0ff72e7ad83;64f48c53-70ab-42d3-9142-740c290390fe)

Forbidden: pass `create_pr=1` as a query parameter to create a Pull Request

Can someone has an idea why this error message and how to solve it?
Thanks in advance for your help.

Don't forget to change the username lol. Had the same issue. You have to re-run the eval cell then run the push to hub cell with your username instead of Thomas'

Oh My...
I'm so ashamed!!!
The worst of it: I've seen it at the very end of the Unit, but not here.
Thanks you very much nicosanc. I think I'll have to change my glasses now!