Skip to content
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

Pinning dm-haiku to 0.0.10 #313

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jonas-eschmann
Copy link

I was trying to run the examples/baselines/rl_continuous/run_sac.py example and ran into the following issue (trying multiple versions of python3 in clean virtual environments):

>>> from acme.agents.jax.d4pg import learning
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/data/venvs/acme/lib/python3.8/site-packages/acme/agents/jax/d4pg/__init__.py", line 17, in <module>
    from acme.agents.jax.d4pg.builder import D4PGBuilder
  File "/data/venvs/acme/lib/python3.8/site-packages/acme/agents/jax/d4pg/builder.py", line 24, in <module>
    from acme.agents.jax import actor_core as actor_core_lib
  File "/data/venvs/acme/lib/python3.8/site-packages/acme/agents/jax/actor_core.py", line 21, in <module>
    from acme.jax import networks as networks_lib
  File "/data/venvs/acme/lib/python3.8/site-packages/acme/jax/networks/__init__.py", line 17, in <module>
    from acme.jax.networks.atari import AtariTorso
  File "/data/venvs/acme/lib/python3.8/site-packages/acme/jax/networks/atari.py", line 27, in <module>
    from acme.jax.networks import base
  File "/data/venvs/acme/lib/python3.8/site-packages/acme/jax/networks/base.py", line 23, in <module>
    from acme.jax import utils as jax_utils
  File "/data/venvs/acme/lib/python3.8/site-packages/acme/jax/utils.py", line 27, in <module>
    import haiku as hk
  File "/data/venvs/acme/lib/python3.8/site-packages/haiku/__init__.py", line 19, in <module>
    from haiku import data_structures
  File "/data/venvs/acme/lib/python3.8/site-packages/haiku/data_structures.py", line 18, in <module>
    from haiku._src.data_structures import to_haiku_dict
  File "/data/venvs/acme/lib/python3.8/site-packages/haiku/_src/data_structures.py", line 30, in <module>
    from haiku._src import utils
  File "/data/venvs/acme/lib/python3.8/site-packages/haiku/_src/utils.py", line 42, in <module>
    def auto_repr(cls: type[Any], *args, **kwargs) -> str:
TypeError: 'type' object is not subscriptable

The same issue seems to exist in the Acme quickstart Colab notebook as well. In both cases, I was able to fix it by pinning dm-haiku==0.0.10. dm-haiku 0.0.11 has been released a couple of days ago so I guess it would be better to pin to 0.0.10 for now so that new users are able to run the examples and the Colab notebook.

The recent 0.0.11 release of dm-haiku seems to break some examples (including the Acme quickstart Colab notebook). Pinning to the previous version solves the issue for now
@JeanElsner
Copy link

I can confirm this and would appreciate a merge, as figuring out the dependencies can be somewhat of a daunting task for new users.
However, version 0.0.10 of dm-haiku actually requires jax version >= 0.4.13 compared to acme's 0.4.3. In practice this is not an issue though. dm-haiku version 0.0.9 also works, but that version pins jax to 0.3.16. Ultimately I suspect this is only a short-term fix that only compounds the problem by pinning another dependency version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants