I want to use a python package association with this GitHub page. I installed it on my system (As suggested in the Github page using Python 3.10 version and on a new environment) which is Windows 10 and I only have CPU (I don’t have GPU).
When I ran:
import bayesnf
I got the following error which is related to JAX:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[7], line 1
----> 1 import bayesnf
File ~pyenvlibsite-packagesbayesnf__init__.py:21
17 # A new PyPI release will be pushed every time __version__ is increased.
18 # When changing this, also update the CHANGELOG.md
19 __version__ = '0.1.3'
---> 21 from .spatiotemporal import BayesianNeuralFieldMAP
22 from .spatiotemporal import BayesianNeuralFieldMLE
23 from .spatiotemporal import BayesianNeuralFieldVI
File ~pyenvlibsite-packagesbayesnfspatiotemporal.py:19
15 """API for Bayesian Neural Field estimators."""
17 from collections.abc import Sequence
---> 19 import jax
20 import jax.numpy as jnp
21 import numpy as np
File ~pyenvlibsite-packagesjax__init__.py:25
22 from jax.version import __version_info__ as __version_info__
24 # Set Cloud TPU env vars if necessary before transitively loading C++ backend
---> 25 from jax._src.cloud_tpu_init import cloud_tpu_init as _cloud_tpu_init
26 try:
27 _cloud_tpu_init()
File ~pyenvlibsite-packagesjax_srccloud_tpu_init.py:17
15 import os
16 from jax import version
---> 17 from jax._src import config
18 from jax._src import hardware_utils
20 running_in_cloud_tpu_vm: bool = False
File ~pyenvlibsite-packagesjax_srcconfig.py:27
24 import threading
25 from typing import Any, Generic, NamedTuple, NoReturn, Protocol, TypeVar, cast
---> 27 from jax._src import lib
28 from jax._src.lib import jax_jit
29 from jax._src.lib import transfer_guard_lib
File ~pyenvlibsite-packagesjax_srclib__init__.py:76
71 return _jaxlib_version
74 version_str = jaxlib.version.__version__
75 version = check_jaxlib_version(
---> 76 jax_version=jax.version.__version__,
77 jaxlib_version=jaxlib.version.__version__,
78 minimum_jaxlib_version=jax.version._minimum_jaxlib_version)
80 # Before importing any C compiled modules from jaxlib, first import the CPU
81 # feature guard module to verify that jaxlib was compiled in a way that only
82 # uses instructions that are present on this machine.
83 import jaxlib.cpu_feature_guard as cpu_feature_guard
AttributeError: partially initialized module 'jax' has no attribute 'version' (most likely due to a circular import)
Given that I have windows 10 and I use CPU only, I’m wondering if it is possible to use this package on my system. Otherwise, I would be appreciated if you help suggest a solution for using it.
The GitHub page says:
The system is build on the JAX machine learning platform.
The typical install time is 1 minute. This software is tested on Python 3.10 with a standard Debian GNU/Linux setup. The large-scale experiments in scripts/ were run using TPU v3-8 accelerators. To run BayesNF locally on medium to large-scale data, a GPU is required at minimum.
1
This error:
AttributeError: partially initialized module 'jax' has no attribute 'version' (most likely due to a circular import)
typically means that you’ve installed incompatible jax
and jaxlib
packages. You can figure out which versions you have installed by running this:
python -m pip list | grep jax
You can install updated JAX and jaxlib versions for CPU by running this:
python -m pip install -U jax
At that point the import should no longer lead to this attribute error.