How to install Cellpose on OnDemand
Cellpose is a general model for cell and nuclear segmentation. The following is a simple, step-by-step guide to installing Cellpose on OnDemand.
More detailed information on installing Cellpose can be found here if needed.
Step 1: Open xterm
When your GPU OnDemand Desktop session starts, right click and select xterm
to open a terminal:
Step 2: Load Anaconda
You need to set up a conda environment, which will contain your Cellpose installation. To do this, you first need to load Anaconda. Type the following in your terminal window and press Enter
:
ml Anaconda3
Step 3: Create Cellpose environment
You then need to create the environment that will contain the Cellpose installation, using the following command:
conda create --name cellpose-env python=3.8
In this example, the environment has been named cellpose-env
, but you can call it whatever you want. The terminal will produce output similar to the following, where user_name
will be replaced with whatever your user name is:
Retrieving notices: ...working... done
Collecting package metadata (current_repodata.json): done
Solving environment: done
## Package Plan ##
environment location: /camp/home/user_name/.conda/envs/cellpose-env
Proceed ([y]/n)?
Press y
and Enter
to proceed.
Step 4: Activate environment
Activate your new Cellpose environment with the following command:
conda activate cellpose-env
Step 5: Install Cellpose
At this point, it is important to note that you have merely created what is essentially an empty environment called cellpose-env
. To actually install Cellpose within this environment, run the following series of commands:
pip install cellpose
pip uninstall torch
conda install pytorch==1.12.0 cudatoolkit=11.3 -c pytorch
The terminal will produce a large amount of output as the necessary packages are installed. Press y
and Enter
to proceed.
Step 6: Verify installation
To test whether the installation was successful, run the following:
cellpose --help
If the installation was successful, this should produce a list of all the parameters that can be used when running Cellpose.
Step 7: Deactivate environment
You can now deactivate your Cellpose environment by running the following:
conda deactivate
Step 8 (Optional): Run Cellpose from FIJI
It is possible to run Cellpose directly from FIJI. Instructions for installing the necessary FIJI Plugin can be found here.
Step 9: Cite!
If you use Cellpose in your work, be sure to cite the relevant paper:
- Version 3 (Latest): Carsen Stringer and Marius Pachitariu. Cellpose3: one-click image restoration for improved cellular segmentation. bioRxiv 2024.02.10.579780
- Version 2: Marius Pachitariu and Carsen Stringer. Cellpose 2.0: how to train your own model. Nature methods, 19(12):1634–1641, 2022.
- Version 1: Carsen Stringer, Tim Wang, Michalis Michaelos, and Marius Pachitariu. Cellpose: a generalist algorithm for cellular segmentation. Nature methods, 18(1):100–106, 2021.