Skip to content

Commit

Permalink
Merge pull request #52 from juglab/napari4.18
Browse files Browse the repository at this point in the history
Napari4.18
  • Loading branch information
jdeschamps authored Aug 29, 2023
2 parents 40317fe + 7036723 commit 7271de4
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 22 deletions.
15 changes: 11 additions & 4 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,28 @@ If you do not have conda, we recommend installing [miniconda](https://docs.conda
operating system.
3. Install `napari` and `napari-n2v`:
```bash
pip install "napari[all]==0.4.15" napari-n2v
pip install "napari[all]" napari-n2v
```

> Note: napari-n2v was tested with TensorFlow 2.7 and 2.10, cuda 11.2 and cudnn
> 8.1.
> Note: napari-n2v was tested with TensorFlow 2.10 (cuda 11.2 and cudnn 8.1) and
TensorFlow 2.13 (cuda 11.8 and cudnn 8.6) on a Linux machine (NVIDIA A40-16Q GPU).

> **Important**: In order to access the GPU with Tensorflow, it is necessary to
> export the CUDA library path in your conda environment. Installation
> instructions on the TensorFlow website do just that.
> For TF 2.10, we recommand running the following in your environment:
> ```bash
> mkdir -p $CONDA_PREFIX/etc/conda/activate.d
> echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib/' > $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh
> ```
> If you encounter the following problem with TF 2.13: "DNN library is not found", you
> can try to run in your environment:
> ```bash
> CUDNN_PATH=$(dirname $(python -c "import nvidia.cudnn;print(nvidia.cudnn.__file__)"))
> export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib/
> ```
## macOS
Expand All @@ -37,7 +44,7 @@ operating system.
1. Set up env with napari and pyqt5
```bash
conda create -n napari-n2v -c conda-forge python=3.9 pyqt imagecodecs napari=0.4.15
conda create -n napari-n2v -c conda-forge python=3.9 pyqt imagecodecs napari
```
2. Install tensorflow following [Apple's instructions](https://developer.apple.com/metal/tensorflow-plugin/)
3. Install napari-n2v
Expand Down
7 changes: 7 additions & 0 deletions envs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Test environments

These environments are used to test the code with different versions of TF in linux.
They will fail on a macOS machine.

See the [documentation](https://juglab.github.io/napari-n2v/installation.html) for
installation steps.
14 changes: 14 additions & 0 deletions envs/tf_old_test_env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: np-n2v
channels:
- conda-forge
- nvidia
- defaults
dependencies:
- python=3.9
- cudatoolkit=11.3
- cudnn=8.1
- pip
- pip:
- tensorflow<2.12
- "napari[all]"
- napari-n2v
14 changes: 14 additions & 0 deletions envs/tf_recent_test_env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: np-n2v
channels:
- conda-forge
- nvidia
- defaults
dependencies:
- python=3.11
- cudatoolkit=11.8.0
- pip
- pip:
- nvidia-cudnn-cu11==8.6.0.163
- tensorflow==2.13.*
- "napari[all]"
- napari-n2v
21 changes: 3 additions & 18 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = napari-n2v
version = 0.1.0
version = 0.1.1
author = Tom Burke, Joran Deschamps
author_email = [email protected]
url = https://github.com/juglab/napari-n2v
Expand Down Expand Up @@ -47,33 +47,18 @@ install_requires =
napari_time_slicer >= 0.4.9

# Also compatibility with napari-workflows
# TODO: it might be better to refactor the napari-workflow code to another repo that would call napari-n2 so that
# TODO: the dependencies would be a bit more relaxed.
# TODO: pin napari to <=0.4.15? vispy<=0.9.6?
# pin napari and vispy because
# https://github.com/napari/napari/issues/4415
# https://github.com/napari/napari/issues/4708
napari<=0.4.15
vispy<=0.9.6
magicgui
napari
qtpy
pyqtgraph

# fix to prevent failing tests
# see https://github.com/napari/napari/pull/5168
# and https://github.com/napari/napari/commit/c42e5ee2d1afd1f26944de3c0657e7bbc813b7d1
imageio>=2.5.0,!=2.11.0,!=2.22.1

# tensorflow
tensorflow>=2.7.0; platform_system!="Darwin" or platform_machine!="arm64"
tensorflow>=2.10.0; platform_system!="Darwin" or platform_machine!="arm64"
tensorflow-macos; platform_system=="Darwin" and platform_machine=="arm64"
tensorflow-metal; platform_system=="Darwin" and platform_machine=="arm64"

# protobuf is a dependency of TensorFlow but the latest versions (>3.20) generate
# errors with npe2. As of TensorFlow 2.10, protobuf<3.20 and >=3.9.2 is enforced.
# Here we set the requirements to be compatible with TF2.8 to TF2.10.
protobuf<3.20,>=3.9.2

[options.extras_require]
testing =
pytest # https://docs.pytest.org/en/latest/contents.html
Expand Down

0 comments on commit 7271de4

Please sign in to comment.