Comments (7)
Does the issue persist with gymnasium==1.0.0a1
? (note: metaworld
may break though)
from gymnasium.
Hi, thanks for your reply.
Beyond this issue, I actually found some other weird bugs in v0.29, such as the asych env vector is actually not asych. The running time is propotional to the num of envs :(
I see v1.0.0a1 gets a lot of update to these vector envs. So, I will give a try, but it will take some time from us to adapt our code base to v1.0.0a1.
from gymnasium.
My guess is that the environment used has a wrapper applied to it, and you can't set the spec for a wrapper (property reasons).
Therefore, I would guess this is a bug but I don't think we will be releasing anymore v0.29 versions to fix this sadly.
I would use gym.vector.make
in the meantime. Hopefully gymnasium.make_vec
will be fix this in the next release.
from gymnasium.
My guess is that the environment used has a wrapper applied to it, and you can't set the spec for a wrapper (property reasons). Therefore, I would guess this is a bug but I don't think we will be releasing anymore v0.29 versions to fix this sadly. I would use
gym.vector.make
in the meantime. Hopefullygymnasium.make_vec
will be fix this in the next release.
I'm wrong, this isn't the problem
class CustomWrapper(gym.Wrapper):
def __init__(self, **kwargs):
super().__init__(gym.make("CartPole-v1", disable_env_checker=True, **kwargs))
# the entry_point is directly the wrapper class which poses an issue as the Wrapper has `metadata` using a property
gym.register("TestEnv-v0", CustomWrapper)
gym.make_vec("TestEnv-v0", num_envs=1)
del gym.registry["TestEnv-v0"]
So I don't know what the issue is.
@BruceGeLi When you updated to v1.0.0, let us know if you still have an issue
from gymnasium.
I've found similar problems. I'm following the warning
WARN: gymnasium.vector.make(...) is deprecated and will be replaced by gymnasium.make_vec(...) in v1.0
Using the following code
envs = gym.make_vec("InvertedPendulum-v4", num_envs = 3, max_episode_steps=600)
it will raise an error, as
File "C:\Users\87182\anaconda3\envs\gymnasium\lib\site-packages\gymnasium\wrappers\record_episode_statistics.py", line 98, in step
self.episode_returns += rewards
ValueError: non-broadcastable output operand with shape (1,) doesn't match the broadcast shape (3,)
Change back to the original function
envs = gym.vector.make("InvertedPendulum-v4", num_envs = 3, max_episode_steps=600)
and it worked
from gymnasium.
My guess is that the environment used has a wrapper applied to it, and you can't set the spec for a wrapper (property reasons). Therefore, I would guess this is a bug but I don't think we will be releasing anymore v0.29 versions to fix this sadly. I would use
gym.vector.make
in the meantime. Hopefullygymnasium.make_vec
will be fix this in the next release.I'm wrong, this isn't the problem
class CustomWrapper(gym.Wrapper): def __init__(self, **kwargs): super().__init__(gym.make("CartPole-v1", disable_env_checker=True, **kwargs)) # the entry_point is directly the wrapper class which poses an issue as the Wrapper has `metadata` using a property gym.register("TestEnv-v0", CustomWrapper) gym.make_vec("TestEnv-v0", num_envs=1) del gym.registry["TestEnv-v0"]So I don't know what the issue is. @BruceGeLi When you updated to v1.0.0, let us know if you still have an issue
Thanks, we will have a try later and will report the result, but will take some time I think.
from gymnasium.
envs = gym.make_vec("InvertedPendulum-v4", num_envs = 3, max_episode_steps=600)
@Zhaohhya Your example doesn't produce an error, could you provide a large example that raises an error
from gymnasium.
Related Issues (20)
- Rework rendering API to allow for simultaneous "human" and "rgb_array" mode rendering HOT 3
- [Bug Report] Calculating rewards for Blackjack toy-text env HOT 5
- [Proposal] Type Hint Error in `async_vector_env`'s `_raise_if_errors` Method Argument HOT 1
- How to record video with updated <site> objects? HOT 9
- [Bug Report] wrappers.vector.RecordEpisodeStatistics computes episode length incorrectly HOT 1
- [Question] Install Gymnasium with `mujoco-py` on M1 HOT 10
- [Question] Reward calculation in HalfCheetah environment HOT 4
- [Bug Report] Promote `PYGAME_HIDE_SUPPORT_PROMPT` to suppress pygame startup message HOT 3
- Can Gymnasium be used on the aarch64 architecture? HOT 1
- [Bug Report] Missing `raise` in `EnvSpec._check_can_jsonify()` HOT 1
- [Proposal] Space.seed should be reproducible for Space.seed HOT 2
- [Question] Ant action space discrepancy HOT 2
- [Question] spherical space HOT 1
- [Question] Discrepancy between Humanoid-v3 and Humanoid-v4 HOT 4
- The dynamics for Toy text environments HOT 3
- [Bug Report] MultiDiscrete spaces' __eq__ method needs to check shape. HOT 3
- [Proposal] new continuous space `Continuous` HOT 1
- [Bug Report] Code examples in Vector API documentation use deprecated "gym.vector.make" instead of "gym.make_vec" HOT 3
- [Proposal] Add Optional State Variable in `initial` method of `FuncEnv` HOT 1
- [Question] Rough timeline for Atari (ALE) support for gymnasium>=1.0. HOT 3
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.