Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HANDS-ON BUG] #509

Open
ADG4050 opened this issue Mar 23, 2024 · 3 comments
Open

[HANDS-ON BUG] #509

ADG4050 opened this issue Mar 23, 2024 · 3 comments

Comments

@ADG4050
Copy link

ADG4050 commented Mar 23, 2024

Describe the bug

The push to hub doesnt work for Unit 2 Taxi-v3, while it worked for the frozen lake environment in the same notebook. The cell runs for 20 mins and then the RAM crashes. There is no error in the running of the cell command.

https://colab.research.google.com/github/huggingface/deep-rl-class/blob/main/notebooks/unit2/unit2.ipynb#scrollTo=dhQtiQozhOn1

Material

  • Did you use Google Colab? (YES)

If not:

  • Your Operating system (OS)
  • Version of your OS
@simoninithomas
Copy link
Member

Hey there 👋 I just tested and it works correctly do you have still this issue?

@zyl-hub
Copy link

zyl-hub commented May 12, 2024

error while running push_to_hub in unit 2 Part 1: Frozen Lake ⛄ (non slippery version)

/usr/local/lib/python3.10/dist-packages/gymnasium/envs/toy_text/frozen_lake.py:328: UserWarning: WARN: You are calling render method without specifying any render mode. You can specify the render_mode at initialization, e.g. gym.make("FrozenLake-v1", render_mode="rgb_array")
  gym.logger.warn(

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

ValueError                                Traceback (most recent call last)

[<ipython-input-106-2c49e77fdc00>](https://localhost:8080/#) in <cell line: 3>()
      1 username = "enchan1" # FILL THIS
      2 repo_name = "q-FrozenLake-v1-4x4-noSlippery"
----> 3 push_to_hub(
      4     repo_id=f"{username}/{repo_name}",
      5     model=model,

3 frames

[<ipython-input-103-8afd6b7fcdc5>](https://localhost:8080/#) in push_to_hub(repo_id, model, env, video_fps, local_repo_path)
    117     # Step 6: Record a video
    118     video_path = repo_local_path / "replay.mp4"
--> 119     record_video(env, model["qtable"], video_path, video_fps)
    120 
    121     # Step 7. Push everything to the Hub

[<ipython-input-102-612cbd9d56e8>](https://localhost:8080/#) in record_video(env, Qtable, out_directory, fps)
     19     img = env.render()
     20     images.append(img)
---> 21   imageio.mimsave(out_directory, [np.array(img) for i, img in enumerate(images)], fps=fps)

[/usr/local/lib/python3.10/dist-packages/imageio/v2.py](https://localhost:8080/#) in mimwrite(uri, ims, format, **kwargs)
    493     imopen_args["legacy_mode"] = True
    494     with imopen(uri, "wI", **imopen_args) as file:
--> 495         return file.write(ims, is_batch=True, **kwargs)
    496 
    497 

[/usr/local/lib/python3.10/dist-packages/imageio/core/legacy_plugin_wrapper.py](https://localhost:8080/#) in write(self, ndimage, is_batch, metadata, **kwargs)
    240 
    241                 if image.ndim < 2:
--> 242                     raise ValueError(
    243                         "The image must have at least two spatial dimensions."
    244                     )

ValueError: The image must have at least two spatial dimensions.

need your help please

@simoninithomas
Copy link
Member

Hey there 👋 , can you provide your colab so that I can test what's wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants