cvai-roig-lab / Net2Brain

BSD 3-Clause "New" or "Revised" License
71 stars 12 forks source link

encoding model does not run easily #82

Open ShreyaKapoor18 opened 2 weeks ago

ShreyaKapoor18 commented 2 weeks ago

Hi dear authors,

I am on a Mac with 64GB of RAM, I am trying to run the encoding model with the following code

results_df_clip = Linear_Encoding(
       feat_path=feat_path,
  roi_path=roi_path,
 model_name=model_name,
 trn_tst_split=0.8,
 n_folds=2,
  n_components=5,
batch_size=10,
   random_state=200,
      return_correlations=True,
     metric = 'pca')
                                            save_path=f"Tutorial_LE_Results/subj{subject}_{network}_{dataset_name}_{keyword}")

However, it takes forever to start.

 roi_path /Users/shreya/Documents/GitHub/objaverse_training_2/Algonauts_NSD/subj01/training_split/training_rois
Linear Encoding for resnet50 ...
  0%|                                                                                                                                        | 0/1 [00:00<?, ?it/s]
Processing fold 1/2:   0%|                                                                                                                   | 0/2 [00:00<?, ?it/s]

I don't know how to increase the RAM or make it faster. I've tried using it on the cluster but it does not seem to use the cluster RAM.

Any help would be appreciated!

Best regards, Shreya

ToastyDom commented 1 week ago

Hey Shreya! Usually it helps to increase the batch size, seeing that your batch size is only at 5. Depending on the amount of your data, you might increase it to 100!

Also good timing on your comment, because I am currently reworking the Linear Encoding module. I also have to say that the progress bar is a little bit misleading, because it still does computations in a lower level but doesn't let the user know of it. I will patch this soon, I hope to upload it next week!

ShreyaKapoor18 commented 1 week ago

Hi @ToastyDom

I am trying it out and working with the larger batch size works But there is no way in which we can make use of a higher compute? Am I wrong?

I was also wondering, for my network there is a lot of temp memory needed to run the RSA using the algonauts dataset. Is there any way I could reduce the temp memory requirements?

Best regards, Shreya