jlakkis / CarDEC

Other
19 stars 4 forks source link

CarDEC.model_counts() NameError: name 'batch_size' is not defined #11

Open AlexSurnov opened 2 years ago

AlexSurnov commented 2 years ago

Hello developers of CarDEC Thank you for your product. Can you please help me to figure out, why the function CarDEC.model_counts() does not work in my hands? I downloaded your macaque retina data set and am trying to repeat all steps of your tutorial. First I imported the packages. The computer returned:

2022-02-28 14:19:22.147693: I tensorflow/core/platform/cpu_feature_guard.cc:151] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 FMA To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.

Next I defined the functions read_macaque , purity_score and find_resolution and read the data set. Then I ran CarDEC_API, and the computer returned:

Trying to set attribute .var of view, copying. /Users/alex/opt/anaconda3/lib/python3.9/site-packages/pandas/core/indexing.py:1732: SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy self._setitem_single_block(indexer, value, name) /Users/alex/opt/anaconda3/lib/python3.9/site-packages/scanpy/preprocessing/_simple.py:843: UserWarning: Revieved a view of an AnnData. Making a copy. view_to_actual(adata) Next CarDEC.build_model(n_clusters = 11). Returned `OMP: Info #271: omp_set_nested routine deprecated, please use omp_set_max_active_levels instead.

Next CarDEC.make_inference(). Works with no warnings. Next CarDEC.model_counts(). An error was returned:

NameError Traceback (most recent call last) /var/folders/jd/2jb1tdwj6_n78vpq2x3m686h0000gq/T/ipykernel_5205/1576722029.py in ----> 1 CarDEC.model_counts()

~/opt/anaconda3/lib/python3.9/site-packages/CarDEC/CarDEC_API.py in model_counts(self, load_weights, act, random_seed, splitseed, optimizer, keep_dispersion, num_epochs, batch_size_count, val_split, lr, decay_factor, patience_LR, patience_ES, denoise_all, denoise_list) 198 199 if denoise_all: --> 200 self.nbmodel.denoise(self.dataset, keep_dispersion, batch_size) 201 if self.LVG: 202 self.nbmodel_lvg.denoise(self.dataset, keep_dispersion, batch_size)

NameError: name 'batch_size' is not defined

I'm doing this all in macOS Monterey Python 3.9.7 pandas 1.3.4 numpy 1.20.3 scikit-learn 0.24.2 (as I understand, this is the same as sklearn, right?) pickle-mixin 1.0.2 pytest 6.2.4 (as I understand, this is the same as shutil, right?) scanpy 1.8.2 anndata 0.7.8 CarDEC 1.0.0

Do you have any idea of what is going on?

Sincerely Alex