pyrddlgym-project / pyRDDLGym

A toolkit for auto-generation of OpenAI Gym environments from RDDL description files.
https://pyrddlgym.readthedocs.io/
MIT License
68 stars 17 forks source link

AttributeError: 'dict' object has no attribute 'split' #248

Closed GMMDMDIDEMS closed 8 months ago

GMMDMDIDEMS commented 8 months ago

There is either an error in def reset(...) or in def run_round(...).

In def run_round(...) state = self.env.reset() is getting assigned a tuple of (obs, {}) from def reset(...).
However, def build_state_msg(..) expects state to be a dict whose key must be a str in order to be able to call split(...).

Possible fixes

  1. Only return obs in def reset(...)
  2. Or state, _ = self.env.reset() in def run_round(...)
mike-gimelfarb commented 8 months ago

Thanks for the fix, it is indeed a missed usage of env that was forgotten when upgrading to gymnasium.