-
-
Notifications
You must be signed in to change notification settings - Fork 810
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
make_vec(...) will raise error "AttributeError: can't set attribute", while vector.make(..) doesn't for customized env #967
Comments
Does the issue persist with |
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. |
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). |
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. |
I've found similar problems. I'm following the warning
Change back to the original function |
Thanks, we will have a try later and will report the result, but will take some time I think. |
@Zhaohhya Your example doesn't produce an error, could you provide a large example that raises an error |
Describe the bug
Hi,
I have some customized RL envs, and I want to create asychronized env vector to make them run in parallel.
Firstly, I used the gymnasium.vector.make(...), and there is some warning saying that it will be deprecated and replaced by the gymnasium.make_vec() function. Thus I decided to use the new one.
My code looks like:
The former make function will raise an error, as
I am not sure if the issue comes from my customized env, as it works ok with the old function.
To reproduce the bug easily, you may need to install the two packages:
where the metaworld is from your organization and fancy_gym is our custimozed RL wrappers...
Code example
System info
gymnasium: 0.29.1, installed as a dependency of fancy_gym package (via pip)
Ubuntu 22.04
conda 23.11.0
python 3.8
Additional context
Thank you in advance.
Checklist
The text was updated successfully, but these errors were encountered: