Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Commit

Permalink
Tensorflow is now optional
Browse files Browse the repository at this point in the history
  • Loading branch information
willGraham01 committed Jul 3, 2023
1 parent d642e34 commit 2356456
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Assuming you have a Python environment set up
(e.g. [using conda](https://brainglobe.info/documentation/general/conda.html)),
you can install `cellfinder-core` with:
```bash
pip install cellfinder-core
pip install cellfinder-core[tensorflow]
```

Once you have [installed napari](https://napari.org/index.html#installation).
Expand All @@ -50,9 +50,18 @@ pip install cellfinder-napari
N.B. To speed up cellfinder, you need CUDA & cuDNN installed. Instructions
[here](https://brainglobe.info/documentation/general/gpu.html).

#### **Manual `tensorflow` installations**
We _strongly recommend_ that when installing, you let `pip` take care of fetching and installing `tensorflow` into your environment for you.
If you would prefer to install `tensorflow` yourself, you can simply
```bash
pip install cellfinder-core
```
Please note that if you take this approach, you must make sure that your manual installation of `tensorflow` is visible to the same Python interpreter as `cellfinder-core`.
`cellfinder-core` requires `tensorflow` at runtime, so if it cannot locate it you will start to get errors whenever you attempt to use `cellfinder` tools.

#### Conda Install
`cellfinder-core` is available on `conda-forge`, however `tensorflow`, one of it's core dependencies, is not.
As a result; you _must_ manually install `tensorflow` into your environment - whether you do this before or after `conda install`ing doesn't matter.
As a result; you _must_ [manually install `tensorflow`](#manual-tensorflow-installations) into your environment - whether you do this before or after `conda install`ing doesn't matter.
Once you are ready, install `cellfinder-core` into the desired environment via conda;
```sh
conda install -c conda-forge cellfinder-core
Expand Down
8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ dependencies = [
"numpy",
"scikit-image",
"scikit-learn",
# See https://github.com/brainglobe/cellfinder-core/issues/103 for < 2.12.0 pin
"tensorflow-macos>=2.5.0,<2.12.0; platform_system=='Darwin' and platform_machine=='arm64'",
"tensorflow>=2.5.0,<2.12.0; platform_system!='Darwin' or platform_machine!='arm64'",
"tifffile",
"tqdm",
]
Expand All @@ -52,6 +49,11 @@ dev = [
"pytest-timeout",
"tox",
]
tensorflow = [
# See https://github.com/brainglobe/cellfinder-core/issues/103 for < 2.12.0 pin
"tensorflow-macos>=2.5.0,<2.12.0; platform_system=='Darwin' and platform_machine=='arm64'",
"tensorflow>=2.5.0,<2.12.0; platform_system!='Darwin' or platform_machine!='arm64'"
]

[project.scripts]
cellfinder_download = "cellfinder_core.download.cli:main"
Expand Down

0 comments on commit 2356456

Please sign in to comment.