Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run cellfinder with JAX in Windows tests in CI #382

Merged
merged 5 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/workflows/test_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ jobs:
include:
- os: macos-latest
python-version: "3.10"
- os: windows-latest
python-version: "3.10"

steps:
# Cache the Keras model so we don't have to remake it every time
Expand Down Expand Up @@ -95,6 +97,8 @@ jobs:
needs: [linting, manifest]
name: Run brainmapper tests to check for breakages
runs-on: ubuntu-latest
env:
KERAS_BACKEND: jax
steps:
- name: Cache Keras model
uses: actions/cache@v3
Expand All @@ -115,10 +119,8 @@ jobs:
- name: Install test dependencies
run: |
python -m pip install --upgrade pip wheel
# Install cellfinder from the latest SHA on this branch
python -m pip install git+$GITHUB_SERVER_URL/$GITHUB_REPOSITORY@$GITHUB_SHA
# Install tensorflow as keras' default backend
python -m pip install "tf-nightly==2.16.0.dev20240101"
# Install cellfinder from the latest SHA on this branch (Keras with JAX backend)
python -m pip install "cellfinder[jax] @ git+$GITHUB_SERVER_URL/$GITHUB_REPOSITORY@$GITHUB_SHA"
# Install checked out copy of brainglobe-workflows
python -m pip install .[dev]

Expand Down
5 changes: 4 additions & 1 deletion cellfinder/core/train/train_yml.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,10 @@ def run(

ensure_directory_exists(output_dir)
model_weights = prep_model_weights(
install_path, model_weights, model, n_free_cpus
model_weights=model_weights,
install_path=install_path,
model_name=model,
n_free_cpus=n_free_cpus,
)

yaml_contents = parse_yaml(yaml_file)
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,6 @@ passenv =
XAUTHORITY
NUMPY_EXPERIMENTAL_ARRAY_FUNCTION
PYVISTA_OFF_SCREEN
platform =
tf: linux|darwin # skip TF backend on windows
"""
Loading