-
Notifications
You must be signed in to change notification settings - Fork 58
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
Cannot import cell2location: Failed in nopython mode pipeline (step: native lowering) #142
Comments
Hi @98xy We have just updated cell2location to the latest scvi-tools version (0.15.3+). Please try re-creating a clean conda environment. The error you observe looks like umap installation version issues. Given that cell2location passes GitHub tests, the problem with UMAP can be specific to your platform. |
Hi @vitkl |
Hi again
This error comes from package version mismatch. Maybe your conda environments don't work correctly.
Do you use `export PYTHONNOUSERSITE="someletters"` as described in the installation section? Maybe you need to add this every time you open the terminal, before activating the conda environment, before creating the conda environment. I have to do that on our compute cluster.
…On Sun, 17 Apr 2022, 09:38 Yin Xu, ***@***.***> wrote:
Hi @98xy <https://github.com/98xy>
We have just updated cell2location to the latest scvi-tools version
(0.15.3+). Please try re-creating a clean conda environment. The error you
observe looks like umap installation version issues. Given that
cell2location passes GitHub tests, the problem with UMAP can be specific to
your platform.
Hi @vitkl <https://github.com/vitkl>
Thanks for your help! I have re-created a clean conda environment but the
error is still exist.
—
Reply to this email directly, view it on GitHub
<#142 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFMFTV6WUE3Y4ZT7FEGFTKLVFPEW5ANCNFSM5S4NY2DQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hi again:
Thanks very much for your help! After `export PYTHONNOUSERSITE="someletters"`, this error removed.
And sorry to disturb you again, another mistake comes now… Could you give me some advice for solving it? Thanks sincerely again!
AttributeError: module 'jaxlib.xla_extension' has no attribute 'CpuDevice'
# details :
--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) Input In [2], in <cell line: 14>() 11 import matplotlib.pyplot as plt 12 import matplotlib as mpl ---> 14 import cell2location 15 import scvi 17 from matplotlib import rcParams File /data/xy/anaconda3/envs/cell2loc_env/lib/python3.9/site-packages/cell2location/__init__.py:5, in <module> 2 from pyro.distributions.transforms import SoftplusTransform 3 from torch.distributions import biject_to, transform_to ----> 5 from .run_c2l import run_cell2location 6 from .run_colocation import run_colocation 7 from .run_regression import run_regression File /data/xy/anaconda3/envs/cell2loc_env/lib/python3.9/site-packages/cell2location/run_c2l.py:18, in <module> 15 import scipy 16 import theano ---> 18 import cell2location.models as models 19 import cell2location.plt as c2lpl 20 from cell2location.cluster_averages import compute_cluster_averages, select_features File /data/xy/anaconda3/envs/cell2loc_env/lib/python3.9/site-packages/cell2location/models/__init__.py:1, in <module> ----> 1 from ._cell2location_model import Cell2location 2 from ._cell2location_module import ( 3 LocationModelLinearDependentWMultiExperimentLocationBackgroundNormLevelGeneAlphaPyroModel, 4 ) 5 from .downstream import CoLocatedGroupsSklearnNMF File /data/xy/anaconda3/envs/cell2loc_env/lib/python3.9/site-packages/cell2location/models/_cell2location_model.py:10, in <module> 8 from pyro import clear_param_store 9 from pyro.nn import PyroModule ---> 10 from scvi import REGISTRY_KEYS 11 from scvi.data import AnnDataManager 12 from scvi.data.fields import ( 13 CategoricalJointObsField, 14 CategoricalObsField, (...) 17 NumericalObsField, 18 ) File /data/xy/anaconda3/envs/cell2loc_env/lib/python3.9/site-packages/scvi/__init__.py:10, in <module> 7 from ._settings import settings 9 # this import needs to come after prior imports to prevent circular import ---> 10 from . import data, model, external, utils 12 # python-poetry/poetry#2366 (comment) 13 # python-poetry/poetry#144 (comment) 14 try: File /data/xy/anaconda3/envs/cell2loc_env/lib/python3.9/site-packages/scvi/model/__init__.py:6, in <module> 4 from ._condscvi import CondSCVI 5 from ._destvi import DestVI ----> 6 from ._jaxscvi import JaxSCVI 7 from ._linear_scvi import LinearSCVI 8 from ._multivi import MULTIVI File /data/xy/anaconda3/envs/cell2loc_env/lib/python3.9/site-packages/scvi/model/_jaxscvi.py:7, in <module> 5 import jax.numpy as jnp 6 import numpy as np ----> 7 import optax 8 import pandas as pd 9 import tqdm File /data/xy/anaconda3/envs/cell2loc_env/lib/python3.9/site-packages/optax/__init__.py:17, in <module> 1 # Copyright 2019 DeepMind Technologies Limited. All Rights Reserved. 2 # 3 # Licensed under the Apache License, Version 2.0 (the "License"); (...) 13 # limitations under the License. 14 # ============================================================================== 15 """Optax: composable gradient processing and optimization, in JAX.""" ---> 17 from optax import experimental 18 from optax._src.alias import adabelief 19 from optax._src.alias import adafactor File /data/xy/anaconda3/envs/cell2loc_env/lib/python3.9/site-packages/optax/experimental/__init__.py:20, in <module> 1 # Copyright 2021 DeepMind Technologies Limited. All Rights Reserved. 2 # 3 # Licensed under the Apache License, Version 2.0 (the "License"); (...) 13 # limitations under the License. 14 # ============================================================================== 15 """Experimental features in Optax. 16 17 Features may be removed or modified at any time. 18 """ ---> 20 from optax._src.experimental.complex_valued import split_real_and_imaginary 21 from optax._src.experimental.complex_valued import SplitRealAndImaginaryState File /data/xy/anaconda3/envs/cell2loc_env/lib/python3.9/site-packages/optax/_src/experimental/complex_valued.py:32, in <module> 15 """Complex-valued optimization. 16 17 When using `split_real_and_imaginary` to wrap an optimizer, we split the complex (...) 27 See details at google-deepmind/optax#196 28 """ 30 from typing import NamedTuple, Union ---> 32 import chex 33 import jax 34 import jax.numpy as jnp File /data/xy/anaconda3/envs/cell2loc_env/lib/python3.9/site-packages/chex/__init__.py:17, in <module> 1 # Copyright 2020 DeepMind Technologies Limited. All Rights Reserved. 2 # 3 # Licensed under the Apache License, Version 2.0 (the "License"); (...) 13 # limitations under the License. 14 # ============================================================================== 15 """Chex: Testing made fun, in JAX!""" ---> 17 from chex._src.asserts import assert_axis_dimension 18 from chex._src.asserts import assert_axis_dimension_comparator 19 from chex._src.asserts import assert_axis_dimension_gt File /data/xy/anaconda3/envs/cell2loc_env/lib/python3.9/site-packages/chex/_src/asserts.py:26, in <module> 23 import unittest 24 from unittest import mock ---> 26 from chex._src import asserts_internal as _ai 27 from chex._src import pytypes 28 import jax File /data/xy/anaconda3/envs/cell2loc_env/lib/python3.9/site-packages/chex/_src/asserts_internal.py:32, in <module> 29 from typing import Any, Sequence, Union, Callable, Optional, Set, Tuple, Type 31 from absl import logging ---> 32 from chex._src import pytypes 33 import jax 34 import jax.numpy as jnp File /data/xy/anaconda3/envs/cell2loc_env/lib/python3.9/site-packages/chex/_src/pytypes.py:40, in <module> 37 PyTreeDef = type(jax.tree_structure(None)) 38 Shape = Tuple[int, ...] ---> 40 CpuDevice = jax.lib.xla_extension.CpuDevice 41 GpuDevice = jax.lib.xla_extension.GpuDevice 42 TpuDevice = jax.lib.xla_extension.TpuDevice AttributeError: module 'jaxlib.xla_extension' has no attribute 'CpuDevice'
…------------------ 原始邮件 ------------------
发件人: "BayraktarLab/cell2location" ***@***.***>;
发送时间: 2022年4月17日(星期天) 下午5:47
***@***.***>;
***@***.******@***.***>;
主题: Re: [BayraktarLab/cell2location] Cannot import cell2location: Failed in nopython mode pipeline (step: native lowering) (Issue #142)
Hi again
This error comes from package version mismatch. Maybe your conda
environments don't work correctly.
Do you use `export PYTHONNOUSERSITE="someletters"` as described in the
installation section? Maybe you need to add this every time you open
terminal, before activating conda environment, before creating conda
environment. I have to do that our compute cluster.
On Sun, 17 Apr 2022, 09:38 Yin Xu, ***@***.***> wrote:
> Hi @98xy <https://github.com/98xy>
>
> We have just updated cell2location to the latest scvi-tools version
> (0.15.3+). Please try re-creating a clean conda environment. The error you
> observe looks like umap installation version issues. Given that
> cell2location passes GitHub tests, the problem with UMAP can be specific to
> your platform.
>
> Hi @vitkl <https://github.com/vitkl>
> Thanks for your help! I have re-created a clean conda environment but the
> error is still exist.
>
> —
> Reply to this email directly, view it on GitHub
> <#142 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AFMFTV6WUE3Y4ZT7FEGFTKLVFPEW5ANCNFSM5S4NY2DQ>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
This is a temporary error with JAX (scvi-tools dependency) - as discussed here: #144 I think you can solve this by installing older jax and jaxlib:
|
Thanks sincerely again for your help! The error has been solved now :)
…------------------ 原始邮件 ------------------
发件人: "BayraktarLab/cell2location" ***@***.***>;
发送时间: 2022年4月17日(星期天) 晚上6:38
***@***.***>;
***@***.******@***.***>;
主题: Re: [BayraktarLab/cell2location] Cannot import cell2location: Failed in nopython mode pipeline (step: native lowering) (Issue #142)
This is a temporary error with JAX (scvi-tools dependency) - as discussed here: #144
I think you can solve this by installing oldex jax and jaxlib:
pip install jax>=0.3,<=0.3.6 jaxlib>=0.1.65,<=0.3.5
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
This does not seem to be a problem anymore (JAX fixed this). If you see similar issues with JAX in the future - could be good to try installing the previous version or wait for a few days until the bug is fixed. |
Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.
Minimal code sample (that we can run without your data, using public data)
This issue came up quite suddenly and it worked normally before. No library-related changes have been made.
The text was updated successfully, but these errors were encountered: