This is a customized fork of deepcell-spots for running DeepCell spot detection in parallel on compute clusters (e.g., SLURM arrays).
This fork includes a modification to deepcell_spots/applications/spot_detection.py to prevent issues when extracting the model archive concurrently in job arrays.
- The model is no longer auto-extracted by every job.
- Prevents file corruption like
PermissionErrorandRead less bytes than requested. - Compatible with SLURM parallel processing of FOV/Z combinations.
Instead of requiring a DEEPCELL_ACCESS_TOKEN, pre-extract the model manually:
mkdir -p ~/.deepcell/models/SpotDetection-8
tar -xzf ~/.deepcell/models/SpotDetection-8.tar.gz -C ~/.deepcell/models/SpotDetection-8git clone https://github.com/tsuijenk/DeepCell-Spots.git
cd DeepCell-SpotsEnsure your environment uses this version of the package.
sbatch ./experimental_run_script/polaris_run_both_xps.shsbatch ./experimental_run_script/batch_merge_polaris_output.shYou do not need to change file permissions on SpotDetection-8.tar.gz.
In this patched version of deepcell-spots, the model is not auto-extracted if the extracted folder already exists. This avoids concurrent extraction issues.
To set it up correctly:
mkdir -p ~/.deepcell/models/SpotDetection-8
tar -xzf ~/.deepcell/models/SpotDetection-8.tar.gz -C ~/.deepcell/models/SpotDetection-8Make sure the following files and directories exist inside ~/.deepcell/models/SpotDetection-8/:
saved_model.pbkeras_metadata.pbvariables/assets/
No access token is required once the model is extracted.