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

module 'jax' has no attribute 'api' #51

Open
khanhpham3799 opened this issue Mar 18, 2022 · 5 comments
Open

module 'jax' has no attribute 'api' #51

khanhpham3799 opened this issue Mar 18, 2022 · 5 comments

Comments

@khanhpham3799
Copy link

when calling: state = jax_utils.replicate(state, devices=devices)
the terminal return: AttributeError: module 'jax' has no attribute 'api'

@xh-liu-tech
Copy link

Same issue.
Upgrading flax from 0.3.4 to 0.3.5 solves the problem for me.

@khanhpham3799
Copy link
Author

i have tried but it said that the latest version only up to 0.3.4

@xh-liu-tech
Copy link

i have tried but it said that the latest version only up to 0.3.4

Maybe you need to upgrade pip3 first.
You can also try to install it offline using a whl file.

@Tomzxcv
Copy link

Tomzxcv commented May 9, 2022

Same issue. Upgrading flax from 0.3.4 to 0.3.5 solves the problem for me.

I get another error when upgrading flax to 0.3.5
Traceback (most recent call last):
File "/home/lhm/NeRF/nerfies/train.py", line 23, in
from flax import jax_utils
File "/home/lhm/anaconda3/envs/nerf-env/lib/python3.9/site-packages/flax/init.py", line 37, in
from . import linen
File "/home/lhm/anaconda3/envs/nerf-env/lib/python3.9/site-packages/flax/linen/init.py", line 23, in
from .attention import (MultiHeadDotProductAttention, SelfAttention,
File "/home/lhm/anaconda3/envs/nerf-env/lib/python3.9/site-packages/flax/linen/attention.py", line 26, in
from flax.linen.linear import default_kernel_init
File "/home/lhm/anaconda3/envs/nerf-env/lib/python3.9/site-packages/flax/linen/linear.py", line 21, in
from flax.linen.module import Module, compact
File "/home/lhm/anaconda3/envs/nerf-env/lib/python3.9/site-packages/flax/linen/module.py", line 31, in
from jax._src.numpy.lax_numpy import isin
ImportError: cannot import name 'isin' from 'jax._src.numpy.lax_numpy' (/home/lhm/anaconda3/envs/nerf-env/lib/python3.9/site-packages/jax/_src/numpy/lax_numpy.py)

@Tomzxcv
Copy link

Tomzxcv commented May 9, 2022

Same issue. Upgrading flax from 0.3.4 to 0.3.5 solves the problem for me.

I get another error when upgrading flax to 0.3.5 Traceback (most recent call last): File "/home/lhm/NeRF/nerfies/train.py", line 23, in from flax import jax_utils File "/home/lhm/anaconda3/envs/nerf-env/lib/python3.9/site-packages/flax/init.py", line 37, in from . import linen File "/home/lhm/anaconda3/envs/nerf-env/lib/python3.9/site-packages/flax/linen/init.py", line 23, in from .attention import (MultiHeadDotProductAttention, SelfAttention, File "/home/lhm/anaconda3/envs/nerf-env/lib/python3.9/site-packages/flax/linen/attention.py", line 26, in from flax.linen.linear import default_kernel_init File "/home/lhm/anaconda3/envs/nerf-env/lib/python3.9/site-packages/flax/linen/linear.py", line 21, in from flax.linen.module import Module, compact File "/home/lhm/anaconda3/envs/nerf-env/lib/python3.9/site-packages/flax/linen/module.py", line 31, in from jax._src.numpy.lax_numpy import isin ImportError: cannot import name 'isin' from 'jax._src.numpy.lax_numpy' (/home/lhm/anaconda3/envs/nerf-env/lib/python3.9/site-packages/jax/_src/numpy/lax_numpy.py)

solver by : "pip install jax==0.3.4 jaxlib==0.3.2"

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

No branches or pull requests

3 participants