Skip to content

HLCA reference model incompatible with scvi-tools > 1.0.3 #269

Description

@luisa-cusick

Thank you for sharing this very useful tool!

I am following the tutorial for HLCA mapping: https://github.com/theislab/scarches/blob/hlca_tutorial_improvements/notebooks/hlca_map_classify.ipynb and I downloaded the most recent HLCA reference model: https://zenodo.org/record/7599104/files/HLCA_reference_model.zip.

I tried loading the model into an sca.models.SCANVI object with the provided command:

surgery_model = sca.models.SCANVI.load_query_data(
    adata_query,
    ref_model_dir,
    freeze_dropout=True,
)

This fails with scvi-tools versions > 1.0.3 because the model base has an added attribute starting in version 1.0.4. I was able to get this working with some changes to my environment, but it would be nice to be able to use the newest version of SCVI. Do you have an updated HLCA scANVI or scVI model?

Here's the full traceback:

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'

Thank you!

Luisa

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions