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

Broken import with latest jax version #1156

Closed
michaelosthege opened this issue Sep 23, 2021 · 1 comment · Fixed by #1157
Closed

Broken import with latest jax version #1156

michaelosthege opened this issue Sep 23, 2021 · 1 comment · Fixed by #1157

Comments

@michaelosthege
Copy link

We're seeing this error in our CI pipeline:

/usr/share/miniconda/envs/pymc3-dev-py39/lib/python3.9/site-packages/numpyro/__init__.py:6: in <module>
    from numpyro import compat, diagnostics, distributions, handlers, infer, optim
/usr/share/miniconda/envs/pymc3-dev-py39/lib/python3.9/site-packages/numpyro/infer/__init__.py:12: in <module>
    from numpyro.infer.hmc import HMC, NUTS
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    from collections import OrderedDict, namedtuple
    import math
    import os
    
>   from jax import device_put, lax, partial, random, vmap
E   ImportError: cannot import name 'partial' from 'jax' (/usr/share/miniconda/envs/pymc3-dev-py39/lib/python3.9/site-packages/jax/__init__.py)

/usr/share/miniconda/envs/pymc3-dev-py39/lib/python3.9/site-packages/numpyro/infer/hmc.py:8: ImportError

Quoting the v0.2.21 release notes:

jax.partial, jax.lax.partial, and jax.util.partial were accidental
exports that have now been removed. Use functools.partial from the Python
standard library instead.

So it'll be an easy fix for you.

michaelosthege added a commit to michaelosthege/pymc that referenced this issue Sep 23, 2021
twiecki pushed a commit to pymc-devs/pymc that referenced this issue Sep 23, 2021
@fehiepsi
Copy link
Member

Thanks for the ping, @michaelosthege! I'll update this shortly.

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 a pull request may close this issue.

2 participants