Oct 22, 2024

Public workspaceInstalling Cellpose for Fiji on a MultiUser Windows VM

This protocol is a draft, published without a DOI.
  • 1The University of Queensland
Icon indicating open access to content
QR code linking to this content
Protocol CitationNicholas D Condon 2024. Installing Cellpose for Fiji on a MultiUser Windows VM. protocols.io https://protocols.io/view/installing-cellpose-for-fiji-on-a-multiuser-window-dp3g5qjw
License: This is an open access protocol distributed under the terms of the Creative Commons Attribution License,  which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited
Protocol status: Working
We use this protocol and it's working and others locally have used it to get it working (Q3-2024)
Created: October 21, 2024
Last Modified: October 22, 2024
Protocol Integer ID: 110408
Abstract
This is a guide to getting Cellpose working on multi user windows VMs with GPU support and a shared models folder
Getting Anaconda Installed
Getting Anaconda Installed
Get the most recentversion of anacondahttps://www.anaconda.com/download



Note you click Skip Registration below the “Submit” button

Navigate to the installation exe (likely in downloads folder) and right click and select Run as administrator.





Click Next and I Agree to progress through the installation tool.

Ensure the installation is for "All Users"



Change the destination folder to a folder created in Public Documents eg:
C:\Users\Public\Documents\Anaconda_MU\ by clicking Browse...



Click Next to install leaving the first two checkboxes selected
Finish the installation and let Anaconda launch itself, comple any update it requests on launch.
Launch Anaconda if it isnt running already
Go to Environments list and update conda by clicking the blue version number on the right and apply at the bottom of the window




Getting Cellpose Installed
Getting Cellpose Installed
Navigate to the Mouseland Cellpose Github page here:
https://github.com/MouseLand/cellpose
Open anaconda prompt and create a new environment

conda create --name cellpose python=3.8

when prompted agree

y

Activate the environment

conda activate cellpose

Install Cellpose

python -m pip install cellpose

Install the GUI for Cellpose

pip install cellpose[gui]

Upgrade cellpose

python -m pip install cellpose --upgrade

remove torch (cpu)

pip uninstall torch
when prompted, agree

y

Go to the pytorch website https://pytorch.org/

Choose the right download command (Stable2.3/Windows/Pip/Python/Cuda12.1)
Copy the prompt to the clipboard
Paste the prompt into the conda environment CLI
e.g.

pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/wh1/cu121

Getting your computer to launch conda from outside of anaconda
Getting your computer to launch conda from outside of anaconda
Enable windows to use conda from command prompt
Add \condabin to PATH environment variable
Click Start & begin to type Environment Variables and open the system properties window and click Environment Variables... button



Change the System variables for Path by clicking Edit...



Click New and then Browse and navigate to the condabin directory within the anaconda install you did earlier at:
C:\Users\Public\Public Documents\Anaconda_MU\Scripts





Click OK to close the window

Click OK to close the Environment Variables window
Click OK to close the System Properties window
Click Start and type in PowerShell and right click and select run as administrator



Type into the PowerShell prompt

conda init
it should return a list of files saying no change/modified



To confirm it is working Press Windows key + R (run) and type in cmd to open Command Prompt
Type the following command

conda env list
You should see your Cellpose environment listed



Getting Cellpose to run from Fiji
Getting Cellpose to run from Fiji
Open Fiji and download the BIOP plugin
Fiji > Help > Update
Choosr the update site PTBIOP



Click Apply Changes & restart Fiji when prompted
Create a new script called Cellpose_config_.ijm in the directory Fiji > Macros> AutoRun

run("Cellpose setup...", "cellposeenvidirectory=C:\\Users\\Public\\Public Documents\\Anaconda_MU\\envs\\cellpose envtype=conda usegpu=true usemxnet=false usefastmode=false useresample=false version=2.0");

Navigate to C:\Users\Public\ and create a directory called .cellpose
Within that directory create a directory called models
Go to the System environment variables again
(Start > "Environment Variables")
Under system environment variables create a New varaible

CELLPOSE_LOCAL_MODELS_PATH
Set the path of the variable to be

C:\Users\Public\.cellpose\models

Dont be surprised if it crashes the first time you run it/It sometimes can timeout downloading all of the model files.