gene_class_dict "NoneType object has no attribute 'items'"

#482
by ag2022 - opened

Hello sorry to bother, i'm once again probably missing something simple.

I'm preparing a new dataset using code that I've run successfully before but running into a new error that has me perplexed.

Here's how i'm initializing my classifier:

cc = Classifier(classifier="cell",
cell_state_dict = {"state_key": "cell_type", "states": "all"},
training_args=training_args,
max_ncells=None,
freeze_layers = 2,
num_crossval_splits = 1,
forward_batch_size=300,
nproc=48,ngpu=4)

and then when I go to prepare my data, I get the following error

cc.prepare_data(input_data_file=input_dataset, output_directory=output_dir, output_prefix=output_prefix)
Traceback (most recent call last):
File "", line 1, in
File "/tmp/Geneformer/geneformer/classifier.py", line 445, in prepare_data
data, id_class_dict = cu.label_classes(
File "/tmp/Geneformer/geneformer/classifier_utils.py", line 120, in label_classes
for key, value_list in gene_class_dict.items():
AttributeError: 'NoneType' object has no attribute 'items'

Have you seen this before? I havent had to pass a gene_class_dict explicitly before. Thank you!!

Thank you for your question! This was due to a recent change implemented to solve an issue with the gene classifier but should only be done in the case of gene classification - we pushed a fix so the updated version should resolve this. Thanks!

ctheodoris changed discussion status to closed

Worked! ty!

Sign up or log in to comment