Skip to content

Commit

Permalink
Make compatible with TensorFlow >= 2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
uschmidt83 committed Aug 19, 2021
1 parent 0018965 commit dfa87b7
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 19 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/tests.yml
Expand Up @@ -17,23 +17,22 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: [3.6, 3.7, 3.8, 3.9]
tensorflow: ["tensorflow", "tensorflow<2"]
tensorflow: ["tensorflow", "'tensorflow<2' 'keras<2.4'"]
exclude:
# https://www.tensorflow.org/install/pip#system-requirements
- python-version: 3.8
tensorflow: "tensorflow<2"
tensorflow: "'tensorflow<2' 'keras<2.4'"
- python-version: 3.9
tensorflow: "tensorflow<2"
tensorflow: "'tensorflow<2' 'keras<2.4'"
- os: windows-latest
tensorflow: "tensorflow<2"
tensorflow: "'tensorflow<2' 'keras<2.4'"

steps:
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- run: python -m pip install --upgrade pip wheel setuptools
- run: pip install pytest
- run: pip install "${{ matrix.tensorflow }}"
- run: pip install ${{ matrix.tensorflow }}
- uses: actions/checkout@v2

- name: Install edt
Expand All @@ -45,13 +44,13 @@ jobs:
run: |
brew config
brew install gcc@9
pip install .
pip install ".[test]"
env:
CC: /usr/local/bin/gcc-9
CXX: /usr/local/bin/g++-9

- name: Install package (Linux and Windows)
if: startsWith(matrix.os, 'macos') == false
run: pip install .
run: pip install ".[test]"

- run: pytest -v --durations=50 -m "not gpu"
15 changes: 7 additions & 8 deletions .github/workflows/tests_cron.yml
Expand Up @@ -12,23 +12,22 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: [3.6, 3.7, 3.8, 3.9]
tensorflow: ["tensorflow", "tensorflow<2"]
tensorflow: ["tensorflow", "'tensorflow<2' 'keras<2.4'"]
exclude:
# https://www.tensorflow.org/install/pip#system-requirements
- python-version: 3.8
tensorflow: "tensorflow<2"
tensorflow: "'tensorflow<2' 'keras<2.4'"
- python-version: 3.9
tensorflow: "tensorflow<2"
tensorflow: "'tensorflow<2' 'keras<2.4'"
- os: windows-latest
tensorflow: "tensorflow<2"
tensorflow: "'tensorflow<2' 'keras<2.4'"

steps:
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- run: python -m pip install --upgrade pip wheel setuptools
- run: pip install pytest
- run: pip install "${{ matrix.tensorflow }}"
- run: pip install ${{ matrix.tensorflow }}
- uses: actions/checkout@v2

- name: Install edt
Expand All @@ -40,14 +39,14 @@ jobs:
run: |
brew config
brew install gcc@9
pip install --no-binary stardist stardist
pip install --no-binary stardist "stardist[test]"
env:
CC: /usr/local/bin/gcc-9
CXX: /usr/local/bin/g++-9

- name: Install package from source (Linux and Windows)
if: startsWith(matrix.os, 'macos') == false
run: pip install --no-binary stardist stardist
run: pip install --no-binary stardist "stardist[test]"

# - name: Install package from wheel
# run: |
Expand Down
10 changes: 9 additions & 1 deletion README.md
Expand Up @@ -54,11 +54,19 @@ compatible with the respective version of TensorFlow. (If you need help and can

2. *StarDist* can then be installed with `pip`:

`pip install stardist`
- If you installed TensorFlow 2 (version *2.x.x*):

pip install stardist

- If you installed TensorFlow 1 (version *1.x.x*):

pip install "stardist[tf1]"


#### Notes

- Depending on your Python installation, you may need to use `pip3` instead of `pip`.
- You can find out which version of TensorFlow is installed via `pip show tensorflow`.
- We provide pre-compiled binaries ("wheels") that should work for most Linux and Windows platforms, and also recent versions of macOS (Catalina/10.15 or later). If you're having problems, please see the [troubleshooting](#installation-1) section below.
- *(Optional)* You need to install [gputools](https://github.com/maweigert/gputools) if you want to use OpenCL-based computations on the GPU to speed up training.
- *(Optional)* You might experience improved performance during training if you additionally install the [Multi-Label Anisotropic 3D Euclidean Distance Transform (MLAEDT-3D)](https://github.com/seung-lab/euclidean-distance-transform-3d).
Expand Down
8 changes: 7 additions & 1 deletion setup.py
Expand Up @@ -106,8 +106,14 @@ def build_extension(self, ext):
],

install_requires=[
'csbdeep>=0.6.0',
'csbdeep>=0.6.3',
'scikit-image',
'numba',
],

extras_require={
"tf1": ["csbdeep[tf1]>=0.6.3"],
"test": ["pytest"],
},

)
2 changes: 1 addition & 1 deletion stardist/version.py
@@ -1 +1 @@
__version__ = '0.7.2'
__version__ = '0.7.3'

0 comments on commit dfa87b7

Please sign in to comment.