facebookresearch / denoised_mdp

Open source code for paper "Denoised MDPs: Learning World Models Better Than the World Itself"
Other
134 stars 11 forks source link

TypeError: Multiple inheritance with NamedTuple is not supported #4

Closed sebimarkgraf closed 2 years ago

sebimarkgraf commented 2 years ago

On Python 3.9 multiple inheritance does not seem to be supported for the NamedTuple. I am uncertain if using a different Python version fixes this, but then a specific Python version should be included in the README.

Traceback (most recent call last):
  File "/home/sebbo/Projekte/denoised_mdp/main.py", line 32, in <module>
    from denoised_mdp.envs import (
  File "/home/sebbo/Projekte/denoised_mdp/denoised_mdp/__init__.py", line 7, in <module>
    from . import envs
  File "/home/sebbo/Projekte/denoised_mdp/denoised_mdp/envs/__init__.py", line 19, in <module>
    from .interaction import env_interact_random_actor, env_interact_with_model, EnvInteractData
  File "/home/sebbo/Projekte/denoised_mdp/denoised_mdp/envs/interaction.py", line 49, in <module>
    class EnvInteractData(Generic[StateT], NamedTuple):  # thank god we py37 https://stackoverflow.com/a/50531189
  File "/usr/lib/python3.9/typing.py", line 1929, in _namedtuple_mro_entries
    raise TypeError("Multiple inheritance with NamedTuple is not supported")
TypeError: Multiple inheritance with NamedTuple is not supported

Maybe, this could be solved by using a dataclass instead of a NamedTuple as it was done at other places.