Comments (2)
Thanks for reporting the issue, it is probably related to NumPy 2.0
You should just need to
import gymnasium as gym
import numpy as np
from gymnasium.utils.play import play
play(
gym.make("CarRacing-v2", render_mode="rgb_array"),
keys_to_action={
"w": np.array([0, 0.7, 0], dtype=np.float32),
"a": np.array([-1, 0, 0], dtype=np.float32),
"s": np.array([0, 0, 1], dtype=np.float32),
"d": np.array([1, 0, 0], dtype=np.float32),
"wa": np.array([-1, 0.7, 0], dtype=np.float32),
"dw": np.array([1, 0.7, 0], dtype=np.float32),
"ds": np.array([1, 0, 1], dtype=np.float32),
"as": np.array([-1, 0, 1], dtype=np.float32),
},
noop=np.array([0, 0, 0])
)
from gymnasium.
@pseudo-rnd-thoughts Awesome! That fixed it for me. I will create a pull request to update the documentation to reflect your code.
from gymnasium.
Related Issues (20)
- [Bug Report] Error in Env Rendering Due to Current Dependency Installation HOT 1
- [Bug Report] Wrapper type hints seem to be specified incorrectly? HOT 1
- [New feature] Add reset options support for functional jax envs HOT 4
- [Bug Report] default_camera_config in MujocoEnv seems not working HOT 6
- [Bug Report] LunarLander continuous mode immediately raises exception due to incompatibility between numpy and box2d HOT 1
- [Bug Report] Custom environment documentation example gif missing HOT 2
- [Question] Wiki / Leaderboards? HOT 1
- [Bug Report] Possibly outdated docstring for TimeLimit max_episode_steps HOT 2
- [Bug Report] CarRacing car_dynamics.py TypeError HOT 1
- AssertionError: Values of the node_space should be instances of Box or Discrete, got <class 'int'> HOT 7
- [Bug Report] TransformObservation not backward compatible due to extra parameter HOT 3
- [Bug Report] No reward threshold for Walker2d-v4 HOT 5
- [Bug Report] gymnasium[all], pygame==2.1.3 not compatible with Python 3.12 HOT 1
- [Bug Report] pip remove ale-py==0.8.1 HOT 2
- [Bug Report] Async Vec Env raise pickle error for ctypes in MujocoRenderer HOT 1
- [Proposal] AsyncVectorEnv with Graph observation spaces HOT 1
- [Bug Report] AsyncVectorEnv observation not batched when observation space is not Box HOT 3
- [Bug Report] VectorizeAction not working HOT 3
- [Bug Report] website defaults to the oldest version HOT 5
- [Bug Report] ValueError: not enough values to unpack (expected 5, got 4) on webgame HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gymnasium.