-
Notifications
You must be signed in to change notification settings - Fork 68
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
Any plan to make Crafter compatible with the latest Gym API? #17
Comments
Hi, I plan to switch to the new API once that's become more widely used than the old one (not sure if that will ever happen though?). I might also switch the env to implement my own API that I use for all projects and then provide wrappers for Gym, Gymnasium, DMEnv, etc. In the meantime, can you patch the seed function? Something along the lines of: def seed(self, seed):
self._seed = seed
Env.seed = seed
env = GymToGymnasium(Env()) Otherwise it's also pretty easy to subclass to implement the seed method or the new API directly. Would be great to see the solution you end up using for others to benefit! :) |
Hi! The problem with the current setup is that seeding depends on the episode as well, and the episode counter is internally increased at every reset call. So doing
produces 2 different observations. This is not the usual behavior with other gym / gymnasium env.
But then one could not do Is having the episode as the environment attribute necessary? I see that it is used only for seeding. If
or, with the new API
|
Hi Catid, first of all thanks so much for your work on an update. I'm having trouble using your updated version. It seems like when I try "pip install git+https://github.com/catid/crafter.git", I still get the "AttributeError: 'Env' object has no attribute 'seed'" issue, leading me to believe my installation process is wrong. Is there another way you recommend installing your updated package? |
The latest Gym API expects
terminated
,truncated
rather than justdone
after aenv.step()
, and seeds the environment withenv.reset(seed=seed)
rather thanenv.seed(seed=seed)
. It is possible to apply a compatibility wrapper by making the env withenv = gym.make('CrafterReward-v1', apply_api_compatibility=True)
but to work properly the base env must have theenv.seed(seed=seed)
function, which yourEnv
class does not have (instead, it has theself._seed
attribute).Is there any plan to add the
env.seed()
function, to make it fully compatible with the latest API? That would also make it compatible with Gymnasium.The text was updated successfully, but these errors were encountered: