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.24k stars 350 forks source link

KeyError: 'setup_method_name' #3029

Open ramadatta opened 1 week ago

ramadatta commented 1 week ago

Hi, thank you for the scVI tools.

I am trying to do label transfer as mentioned here:

I am getting following error with new conda environment and pip installation of scarches.

May I know how this can be resolved? Many thanks in advance!

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
Cell In[89], line 1
----> 1 surgery_model = sca.models.SCANVI.load_query_data(
      2     adata_query,
      3     ref_model_dir, #reference_model
      4     freeze_dropout=True,
      )

File [~/.local/lib/python3.12/site-packages/scvi/model/base/_archesmixin.py:122](http://127.0.0.1:8888/lab/tree/dir/~/.local/lib/python3.12/site-packages/scvi/model/base/_archesmixin.py#line=121), in ArchesMixin.load_query_data(cls, adata, reference_model, inplace_subset_query_vars, accelerator, device, unfrozen, freeze_dropout, freeze_expression, freeze_decoder_first_layer, freeze_batchnorm_encoder, freeze_batchnorm_decoder, freeze_classifier)
    116 if _SETUP_ARGS_KEY not in registry:
    117     raise ValueError(
    118         "Saved model does not contain original setup inputs. "
    119         "Cannot load the original setup."
    120     )
--> 122 setup_method = getattr(cls, registry[_SETUP_METHOD_NAME])
    123 setup_method(
    124     adata,
    125     source_registry=registry,
   (...)
    128     **registry[_SETUP_ARGS_KEY],
    129 )
    131 model = _initialize_model(cls, adata, attr_dict)

KeyError: 'setup_method_name'
canergen commented 1 week ago

Hi, we can't provide support for scArches use of our models. It's better to ask their developers for help. You might want to check our tutorial for the HLCA using Arches mapping: https://docs.scvi-tools.org/en/latest/tutorials/notebooks/scrna/query_hlca_knn.html. Please update if this tutorial doesn't work.