scverse / scvi-tools

Deep probabilistic analysis of single-cell and spatial omics data
http://scvi-tools.org/
BSD 3-Clause "New" or "Revised" License
1.17k stars 343 forks source link

AttributeError: module 'scvi' has no attribute 'autotune' #2784

Closed itamarb-cgen closed 1 week ago

itamarb-cgen commented 2 months ago

autotune fails with an error message no attribute 'autotune'. I created a fresh conda environment with the latest scvi-tools on python 3.11. Please advise, Itamar

tuner = scvi.autotune.ModelTuner(model_cls)
tuner
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[15], line 1
----> 1 tuner = scvi.autotune.ModelTuner(model_cls)
      2 tuner

AttributeError: module 'scvi' has no attribute 'autotune'

Versions:

print (scvi.__version__)

1.1.2

sc.logging.print_header()

scanpy==1.10.1 anndata==0.10.7 umap==0.5.5 numpy==1.26.4 scipy==1.13.0 pandas==2.2.2 scikit-learn==1.4.2 statsmodels==0.14.1 igraph==0.11.5 pynndescent==0.5.12

martinkim0 commented 2 months ago

Hi, please try from scvi.autotune import ModelTuner

itamarb-cgen commented 2 months ago

Thank you Martin! This indeed helped proceed. Note that a few more installations are needed: conda install hyperopt pip install "ray[tune]" with from ray import tune

Unfortunately, I encounter another error later in tuner.fit: 'ValueError: Grid search parameters cannot be automatically converted to a HyperOpt search space.' What can be the problem here? Best regards, Itamar

martinkim0 commented 2 months ago

Hi, sorry forgot to mention, you can install all autotune dependencies with

pip install -U "scvi-tools[autotune]"

For the error message, could you share the code you're running? Thanks

martinkim0 commented 1 week ago

Closed due to inactivity