Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'SCVI' object has no attribute 'eval' #2740

Closed
FZ-hajji opened this issue Apr 22, 2024 · 2 comments
Closed

'SCVI' object has no attribute 'eval' #2740

FZ-hajji opened this issue Apr 22, 2024 · 2 comments

Comments

@FZ-hajji
Copy link

Hello ,

I used the following code to save and load scvi model:
model.save("my_model/")
model = scvi.model.SCVI.load("my_model/", adata=adata)
model.eval()

But when I apply eval() to the model I get this error:
'SCVI' object has no attribute 'eval'

@martinkim0
Copy link
Contributor

Hi, this is because SCVI is not an instance of torch.nn.Module. For this, you would need to call model.module.eval. However, this is not necessary in this case as we already call eval in our load function here.

@FZ-hajji
Copy link
Author

Thank you so much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants