huggingface/deep-rl-class

[HANDS-ON BUG] Funny bug with Unit 8

dbailleul opened this issue · 1 comments

I used Google Colab on Win10.

If I do not specify my account name in the repo-id, it's like the pipeline is trying to push the model on Thomas repo:

!python ppo.py --env-id="LunarLander-v2" --repo-id="ppo-LunarLander-v2-unit8" --total-timesteps=50000

ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating name
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5701:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM default
IMAGEIO FFMPEG_WRITER WARNING: input image is not divisible by macro_block_size=16, resizing from (600, 400) to (608, 400) to ensure video compatibility with most codecs and players. To prevent resizing, make your input image divisible by the macro_block_size or set the macro_block_size to 1 (risking incompatibility).
[swscaler @ 0x64dd300] Warning: data is not aligned! This can lead to a speed loss
ℹ Pushing repo ppo-LunarLander-v2-unit8 to the Hugging Face Hub
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_errors.py", line 270, in hf_raise_for_status
    response.raise_for_status()
  File "/usr/local/lib/python3.10/dist-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://huggingface.co/api/models/ppo-LunarLander-v2-unit8/preupload/main

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

Traceback (most recent call last):
  File "/content/ppo.py", line 590, in <module>
    package_to_hub(
  File "/content/ppo.py", line 179, in package_to_hub
    repo_url = upload_folder(
  File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn
    return fn(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/hf_api.py", line 1045, in _inner
    return fn(self, *args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/hf_api.py", line 4138, in upload_folder
    commit_info = self.create_commit(
  File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn
    return fn(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/hf_api.py", line 1045, in _inner
    return fn(self, *args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/hf_api.py", line 3195, in create_commit
    self.preupload_lfs_files(
  File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/hf_api.py", line 3648, in preupload_lfs_files
    _fetch_upload_modes(
  File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn
    return fn(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/_commit_api.py", line 488, in _fetch_upload_modes
    hf_raise_for_status(resp)
  File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_errors.py", line 320, in hf_raise_for_status
    raise RepositoryNotFoundError(message, response) from e
huggingface_hub.utils._errors.RepositoryNotFoundError: 404 Client Error. (Request ID: Root=1-6582f08d-6345eba2161225164109745f;43bfab2e-6aa5-41c1-8b60-779ab986f35e)

Repository Not Found for url: https://huggingface.co/api/models/ppo-LunarLander-v2-unit8/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.
Note: Creating a commit assumes that the repo already exists on the Huggingface Hub. Please use `create_repo` if it's not the case.

With my account name in the repo-id, everything works properly:

!python ppo.py --env-id="LunarLander-v2" --repo-id="dbailleul/ppo-LunarLander-v2-unit8" --total-timesteps=50000

What is strange is that I've check the url generated, and it was correct:

from huggingface_hub import HfApi
repo_id = "ppo-LunarLander-v2-unit8"
token = "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"
repo_url = HfApi().create_repo(
      repo_id=repo_id,
      token=token,
      private=False,
      exist_ok=True,
  )

print(repo_url)

https://huggingface.co/dbailleul/ppo-LunarLander-v2-unit8

So... yeah. Just don't do that.

Hey there 👋 , yes that's normal. repo_id = username + / + repo name. So if you only defined this, it takes the default repo_id