Skip to content

TypeError: __init__() got an unexpected keyword argument 'n_epochs'  #249

Open
@gaoyifei1122

Description

@gaoyifei1122

Hi, I really love scArches, but I'm encountering a problem.
I want to train my scVI models with the following parameters:
early_stopping_kwargs = {
"early_stopping_metric": "accuracy",
"save_best_state_metric": "accuracy",
"on": "full dataset",
"patience": 10,
"threshold": 0.001,
"reduce_lr_on_plateau": True,
"lr_patience": 8,
"lr_factor": 0.1,
}
Here's how I set up and train the model:
sca.models.SCVI.setup_anndata(source_adata, batch_key=condition_key, labels_key=cell_type_key)
vae = sca.models.SCVI(
source_adata,
n_layers=2,
encode_covariates=True,
deeply_inject_covariates=False,
use_layer_norm="both",
use_batch_norm="none",
)
vae.train(n_epochs=200, frequency=1, early_stopping_kwargs=early_stopping_kwargs)
However, I receive the following error: :
TypeError: init() got an unexpected keyword argument 'n_epochs'
Could this issue be related to version compatibility? I am using scarches-0.5.4 and scvi-tools version 1.1.6.
Plz help!

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