Elvis Kidzeru
Elvis Kidzeru

Reputation: 1

scVI (single-cell Variational Inference)

I am trying to get latents variables after training a scvi model and I am having this error message

# Get latent representations of the data
latent = model.get_latents()

Please have someone come across this error or please can someone assist? I want to do cell annotation

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[48], line 5
      1 ### Using directives from ChatGPT - Step 7. Use scVI to Extract Latent Variables
      2 # Once the model is trained, you can use it to extract low-dimensional representations (latent variables) of the data that capture the underlying structure of the cell types.
      3 
      4 # Get latent representations of the data
----> 5 latent = model.get_latents()

AttributeError: 'SCVI' object has no attribute 'get_latents'

Upvotes: 0

Views: 16

Answers (1)

Qian
Qian

Reputation: 595

Because the SCVI model does not include a method named get_latents(). The correct method is called get_latent_representation()

Reference https://docs.scvi-tools.org/en/stable/api/reference/scvi.model.SCVI.html

Upvotes: 0

Related Questions