Skip to content

Commit

Permalink
Updated setup instructions for newer version of stardist; CUDA v10.1 …
Browse files Browse the repository at this point in the history
…environment did not function anymore. Fixed intensity column name when only one channel is present from "Intensity" to "Intensity Mean" in order to unify column names.
  • Loading branch information
ArtoVi committed Jul 2, 2021
1 parent 18f2c58 commit 0738d7c
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 28 deletions.
38 changes: 17 additions & 21 deletions docs/environment_setup.txt
Original file line number Diff line number Diff line change
@@ -1,32 +1,28 @@
SETUP OF ENVIRONMENT
--------------------
Instruction below is for the setup on Win 10 using CUDA v10.1. Setup will be different depending on
operating system.
Instruction below is for the setup on Win 10. Different versions may be used, but the following setup has been tested.
Setup will be different depending on operating system.

1. Update GPU drivers
2. Install visual studio + individual components:
a) MSVC v142 - VS 2019 C++ x64/x86 build tools
b) Windows 10 SDK (10.0.18362.0)
3. Download CUDA toolkit 10.1 Update 2
3. Download CUDA (here v11.4)
a) install only 'Developer' and 'Runtime' modules
4. Download CuDNN 7.6.5 for CUDA 10.1
a) unpack to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\
4. Download CuDNN v8.2.1.32 for CUDA 11.4
a) unpack to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4\
5. Add system variables (Control panel > Edit system environment variables):
[NAME & PATH]
a) INCLUDE C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include
b) LIB C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\lib\x64
a) INCLUDE C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4\include
b) LIB C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4\lib\x64
6. Create Python/Anaconda environment
a) Packages:
tensorflow-gpu==2.3.1
jupyter-tensorboard
nodejs==0.1.1
npm==0.1.1
pybind11==2.5.0
gputools==0.2.9
stardist
numpy
pandas
pathlib
tifffile
b) on Windows, install PyOpenCL from pre-made binary:
https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyopencl
a) 1. conda create -n stardistenv python=3.9
2. conda activate stardistenv
-------OR-------
1. python -m virtualenv stardistenv
2. stardistenv\Scripts\activate

b) Install packages:
pip install tensorflow jupyter-tensorboard nodejs npm pybind11 gputools stardist pandas pathlib tifffile scikit-tensor-py3 pyopencl
!!! on Windows, install PyOpenCL from pre-made binary (https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyopencl):
i.e. above, in pip install-command change pyopencl to path\to\pyopencl.whl
14 changes: 9 additions & 5 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
tensorflow-gpu # ==2.3.1
tensorflow
jupyter-tensorboard
nodejs # ==0.1.1
npm # ==0.1.1
pybind11 # ==2.5.0
gputools # ==0.2.9
nodejs
npm
pybind11
gputools
stardist
pandas
pathlib
tifffile
scikit-tensor-py3
pyopencl

# pip install tensorflow jupyter-tensorboard nodejs npm pybind11 gputools stardist pandas pathlib tifffile scikit-tensor-py3 pyopencl
# ON WIN10 REPLACE PYOPENCL WITH path\to\pyopencl.whl
2 changes: 1 addition & 1 deletion predictSD/labelCollect.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def _get_intensities(self, notnull: tuple) -> dict:
if self.image.channels is not None:
return {f"Intensity Mean_Ch={ch}": self.image.get_channels(ch)[notnull]
for ch in np.arange(0, self.image.channels)}
return {"Intensity": self.image.img[notnull]}
return {"Intensity Mean": self.image.img[notnull]}

def _test_img_shapes(self) -> None:
"""Assert that image and label file shapes match."""
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ each label in the segmentation images is marked by a single, unique value.
## Installation
PredictSD requires an environment that is capable of running StarDist. For the creation of such environment, see
[StarDist's GitHub-page](https://github.com/stardist/stardist/). Required packages are listed in
'predictSD/docs/requirements.txt'. For installation on Win10 using CUDA 10.1, see
'predictSD/docs/requirements.txt'. For installation on Win10 using CUDA 11.4, see
'predictSD/docs/environment_setup.txt'.

## labelCollect.py
Expand Down

0 comments on commit 0738d7c

Please sign in to comment.