alihaydaroglu / suite3d

Fast, accurate, volumetric cell detection. Developed for Light Beads Microscopy, usable for other volumetric 2P. In development
6 stars 0 forks source link

sweep_params crash #29

Closed oterocoronel closed 1 year ago

oterocoronel commented 1 year ago

Here's the log and the error info:

Using conv_filt: gaussian, 0.75, 1.00
   Using np_filt: gaussian, 1.00, 5.00
   Using normalization exponent of 1.00
   Running only 1 batches
   Created files and dirs for 1 batches
   Will reconstruct SVD movie on-the-fly from  with 200 components
   Loaded spatial components in 15.69 seconds, 20.86 GB
      Running batch 1 of 1
      Reconstructing from svd
         Loaded Us
      Reconstructed in 63.79 seconds
      Calculating corr map
         Rolling mean filter
         Stdev over time
         Sharr creation
         Sub and conv
         Vmap
      Calculated corr map in 73.96 seconds
      Saving to /home/freiwald/Data/analysis_2pRAM/Louwho/20230716d/175813tUTC_Max15_depth350um_fov5256x5250um_res4p00x4p00umpx_fr01p994Hz_pow339p6mW/s3d-Louwho_s3d/sweep-01/sweep-01-comb_00000/iters/batch0000
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In[12], line 4
      1 #sweep_summary = job.sweep_params(params_to_sweep, svd_info,testing_dir_tag='sweep-01',
      2 #                           do_vmap=True, all_combinations=True, n_test_iters = 1)
      3 tic = time.time()
----> 4 sweep_summary = job.sweep_params(params_to_sweep, svd_info, testing_dir_tag='sweep-01',
      5                            do_vmap=True, all_combinations=True, n_test_iters = 1)
      6 toc = time.time()

File /mnt/MarmoScope_Windows10/FreiwaldSync/MarmoScope/Analysis/SantiVersions/suite2p_LBM/s2p-lbm/suite2p/suite2p/suite3d/job.py:816, in Job.sweep_params(self, params_to_sweep, svd_info, mov, testing_dir_tag, n_test_iters, all_combinations, do_vmap, svs, us, test_parent_dir, delete_mov_sub)
    813 self.log("Saving to tag %s at %s" % (comb_dir_tag,comb_dir), 2) 
    814 self.params = comb_params[comb_idx]
    815 (vmap, mean_img, max_img), mov_sub_dir, iter_dir = \
--> 816                             self.calculate_corr_map(mov=mov, svd_info=svd_info, parent_dir = comb_dir_tag,
    817                             iter_limit=n_test_iters, update_main_params=False, svs=svs, us=us)
    818 if delete_mov_sub:
    819     self.log("Removing mov_sub from %s" % mov_sub_dir)

File /mnt/MarmoScope_Windows10/FreiwaldSync/MarmoScope/Analysis/SantiVersions/suite2p_LBM/s2p-lbm/suite2p/suite2p/suite3d/job.py:308, in Job.calculate_corr_map(self, mov, save, return_mov_filt, crop, svd_info, iter_limit, parent_dir, update_main_params, svs, us)
    304         self.log("Cropped movie to shape: %s" % str(mov.shape))
    305     out =  calculate_corrmap(mov, self.params, self.dirs, self.log, return_mov_filt=return_mov_filt, save=save,
    306                             iter_limit=iter_limit, iter_dir_tag=iter_dir_tag, mov_sub_dir_tag=mov_sub_dir_tag)
--> 308 return out, mov_sub_dir, job.dirs[iter_dir_tag]

NameError: name 'job' is not defined

params =

{'fs': 1.99407,
 'tau': 0.15,
 'planes': array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14]),
 'convert_plane_ids_to_channel_ids': False,
 'notch_filt': None,
 'n_init_files': 4,
 'init_file_pool': None,
 'init_file_sample_method': 'even',
 'init_n_frames': None,
 'enforce_positivity': True,
 'subtract_crosstalk': False,
 'override_crosstalk': 0,
 'crosstalk_percentile': 99.5,
 'crosstalk_sigma': 0.01,
 'crosstalk_n_planes': 10,
 'nonrigid': True,
 'smooth_sigma': 1.15,
 'maxregshift': 0.15,
 'reg_filter_pcorr': 1,
 'generate_sample_registered_bins': False,
 'tif_batch_size': 1,
 'n_skip': 0,
 'fuse_crop': ((0, 15), (0, 1350), (0, 1350)),
 'split_tif_size': 100,
 'svd_crop': ((0, 15), (350, 950), (350, 950)),
 'svd_time_crop': (None, None),
 'n_svd_comp': 200.0,
 'svd_block_shape': (4, 200, 200),
 'svd_block_overlaps': (2, 100, 100),
 'svd_pix_chunk': 80000,
 'svd_time_chunk': 4000,
 'svd_save_time_chunk': 400,
 'svd_save_comp_chunk': 100,
 'n_svd_blocks_per_batch': 1,
 'sdnorm_exp': 1.0,
 'npil_filt_type': 'gaussian',
 'npil_filt_xy': 5.0,
 'npil_filt_z': 1.0,
 'conv_filt_type': 'gaussian',
 'conv_filt_xy': 1.0,
 'conv_filt_z': 0.75,
 'intensity_thresh': 0.2,
 'temporal_hpf': 400,
 't_batch_size': 400,
 'mproc_batchsize': 25,
 'n_proc_corr': 19,
 'dtype': numpy.float32,
 'patch_size_xy': (120, 120),
 'patch_overlap_xy': (25, 25),
 'activity_thresh': 4.0,
 'percentile': 99.0,
 'extend_thresh': 0.2,
 'roi_ext_iterations': 2,
 'max_iter': 10000,
 'detection_timebin': 1,
 'detection_time_crop': (None, None),
 'allow_overlap': False,
 'recompute_v': None,
 'normalize_vmap': False,
 'max_pix': 500,
 'npil_coeff': 0.7,
 'dcnv_baseline': 'maximin',
 'dcnv_win_baseline': 60,
 'dcnv_sig_baseline': 10,
 'dcnv_prctile_baseline': 8,
 'dcnv_batchsize': 3000,
 'subjects_dir': None,
 'subject': None,
 'expnum': None,
 'date': None,
oterocoronel commented 1 year ago

replacing job.dirs[iter_dir_tag] with self.dirs[iter_dir_tag] fixed the issue

alihaydaroglu commented 1 year ago

fixed now, thank you