# How to create scANVI model from a scVI model without labels\_key?

**URL:** <https://discourse.scverse.org/t/how-to-create-scanvi-model-from-a-scvi-model-without-labels-key/2312>\
**Category:** Help\
**Tags:** scanvi\
**Created:** [June 3, 2024, 6:54am UTC](https://discourse.scverse.org/t/how-to-create-scanvi-model-from-a-scvi-model-without-labels-key/2312 "2024-06-03T06:54:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xicici-Yan](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/xicici-yan/32/1066_2.png) [@Xicici-Yan](https://discourse.scverse.org/u/Xicici-Yan)\
**Post date:** [June 3, 2024, 6:54am UTC](https://discourse.scverse.org/t/how-to-create-scanvi-model-from-a-scvi-model-without-labels-key/2312/1 "2024-06-03T06:54:06Z")

</div>

I had not set labels\_key when first using. `sca.models.SCVI.setup_anndata(source_adata,batch_key=condition_key)`. After annotated all cells, how could I create a scANVI model with the first scVI model? Or, should I just try to train a new scVI model with ‘labels\_key’.

---

<div class="post-metadata">

**Author:** ![martinkim0](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/martinkim0/32/881_2.png) [@martinkim0](https://discourse.scverse.org/u/martinkim0)\
**Post date:** [June 4, 2024, 3:49pm UTC](https://discourse.scverse.org/t/how-to-create-scanvi-model-from-a-scvi-model-without-labels-key/2312/2 "2024-06-04T15:49:09Z")

</div>

Hi, we have an example of that in [this](https://docs.scvi-tools.org/en/stable/tutorials/notebooks/scrna/harmonization.html) tutorial, where you can set a new labels key for scANVI after training with scVI.

---

<div class="post-metadata">

**Author:** ![Xicici-Yan](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/xicici-yan/32/1066_2.png) [@Xicici-Yan](https://discourse.scverse.org/u/Xicici-Yan)\
**Post date:** [June 5, 2024, 5:46am UTC](https://discourse.scverse.org/t/how-to-create-scanvi-model-from-a-scvi-model-without-labels-key/2312/3 "2024-06-05T05:46:25Z")

</div>

Thanks so much, it is useful when using scarches same as scvi-tools.
