You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I run the following code:
#Configure the BulkTrajBlend model
#要求输入的bulk数据和scRNA数据都得是counts
bulktb=ov.bulk2single.BulkTrajBlend(bulk_seq=bulk_data,
single_seq=adata_counts,
# bulk_group=['dg_d_1','dg_d_2','dg_d_3'],
celltype_key='scsa_celltype_cellmarker',)
bulktb.vae_configure(cell_target_num=None) #the key of this error, but I can not understand the reason
File ~/miniconda3/envs/omicverse/lib/python3.10/site-packages/omicverse/bulk2single/_bulk2single.py:366, in Bulk2Single.__get_model_input(self, data, cell_target_num)
364 # FeaSize = single_cell.shape[1]
365 feature_size = single_cell.shape[1]
--> 366 assert nclass == len(cell_target_num.keys()), "cell type num no match!!!"
368 for i in range(len(breed_set)):
369 dic[breed_2_list[i]] = i
AssertionError: cell type num no match!!!
The text was updated successfully, but these errors were encountered:
I run the following code:
#Configure the BulkTrajBlend model
#要求输入的bulk数据和scRNA数据都得是counts
bulktb=ov.bulk2single.BulkTrajBlend(bulk_seq=bulk_data,
single_seq=adata_counts,
# bulk_group=['dg_d_1','dg_d_2','dg_d_3'],
celltype_key='scsa_celltype_cellmarker',)
bulktb.vae_configure(cell_target_num=None) #the key of this error, but I can not understand the reason
vae_net=bulktb.vae_train(
batch_size=512,
learning_rate=1e-4,
hidden_size=256,
epoch_num=3500,
vae_save_dir='./output',
vae_save_name='TED_PBMC_vae',
generate_save_dir='./output',
generate_save_name='TED_PBMC_vae_generate')
the following error will be found:
AssertionError Traceback (most recent call last)
Cell In[33], line 4
1 #Training the beta-VAE model
2
3 #这里老报错
----> 4 vae_net=bulktb.vae_train(
5 batch_size=512,
6 learning_rate=1e-4,
7 hidden_size=256,
8 epoch_num=3500,
9 vae_save_dir='./output',
10 vae_save_name='TED_PBMC_vae',
11 generate_save_dir='./output',
12 generate_save_name='TED_PBMC_vae_generate')
File ~/miniconda3/envs/omicverse/lib/python3.10/site-packages/omicverse/bulk2single/_bulktrajblend.py:154, in BulkTrajBlend.vae_train(self, vae_save_dir, vae_save_name, generate_save_dir, generate_save_name, batch_size, learning_rate, hidden_size, epoch_num, patience, save)
127 def vae_train(self,
128 vae_save_dir:str='save_model',
129 vae_save_name:str='vae',
(...)
135 epoch_num:int=5000,
136 patience:int=50,save:bool=True):
137 r"""
138 Train the VAE model of BulkTrajBlend.
139
(...)
151
152 """
--> 154 self.vae_net=self.vae_model.train(
155 batch_size=batch_size,
156 learning_rate=learning_rate,
157 hidden_size=hidden_size,
158 epoch_num=epoch_num,
159 vae_save_dir=vae_save_dir,
160 vae_save_name=vae_save_name,
161 generate_save_dir=generate_save_dir,
162 generate_save_name=generate_save_name,
163 patience=patience,save=save)
File ~/miniconda3/envs/omicverse/lib/python3.10/site-packages/omicverse/bulk2single/_bulk2single.py:181, in Bulk2Single.train(self, vae_save_dir, vae_save_name, generate_save_dir, generate_save_name, batch_size, learning_rate, hidden_size, epoch_num, patience, save)
178 if self.input_data==None:
179 self.prepare_input()
180 single_cell, label, breed_2_list, index_2_gene, cell_number_target_num,
--> 181 nclass, ntrain, feature_size = self.__get_model_input(self.input_data, self.cell_target_num)
182 print('...begin vae training')
183 vae_net,history = train_vae(single_cell,
184 label,
185 self.used_device,
(...)
190 hidden_size=hidden_size,
191 patience=patience,)
File ~/miniconda3/envs/omicverse/lib/python3.10/site-packages/omicverse/bulk2single/_bulk2single.py:366, in Bulk2Single.__get_model_input(self, data, cell_target_num)
364 # FeaSize = single_cell.shape[1]
365 feature_size = single_cell.shape[1]
--> 366 assert nclass == len(cell_target_num.keys()), "cell type num no match!!!"
368 for i in range(len(breed_set)):
369 dic[breed_2_list[i]] = i
AssertionError: cell type num no match!!!
The text was updated successfully, but these errors were encountered: