From e89683c29ba62966864ffe043dd144565fd511bf Mon Sep 17 00:00:00 2001 From: danielnugraha Date: Mon, 15 May 2023 16:04:15 +0200 Subject: [PATCH 01/27] add script to test if requirements.txt is set correctly --- dev/check-requirements-txt.sh | 43 +++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 dev/check-requirements-txt.sh diff --git a/dev/check-requirements-txt.sh b/dev/check-requirements-txt.sh new file mode 100755 index 00000000000..4f9bea9dda8 --- /dev/null +++ b/dev/check-requirements-txt.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +# Copyright 2023 Flower Labs GmbH. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================== + +set -e +cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/../ + +# Purpose of this script is to evaluate if the user changed the pyproject.toml definitions +# but did not regenerate or commit the new requirements.txt files + +# Regenerate requirements.txt +pip install pipreqs + +for path in $(find . -type f -name '*pyproject*' | sed -E 's|/[^/]+$||' |sort -u) +do + pipreqs $path +done + +pip uninstall pipreqs + +# Fail if user forgot to recompile +CHANGED=$(git diff --name-only HEAD examples) + +if [ -n "$CHANGED" ]; then + echo "Changes detected" + exit 1 +fi + +echo "No changes detected" +exit 0 From 019c38d9036c78ff266361164d4e1aee6262fcb4 Mon Sep 17 00:00:00 2001 From: danielnugraha Date: Mon, 15 May 2023 16:12:34 +0200 Subject: [PATCH 02/27] generate requirements.txt --- dev/check-requirements-txt.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dev/check-requirements-txt.sh b/dev/check-requirements-txt.sh index 4f9bea9dda8..fd5ae79d687 100755 --- a/dev/check-requirements-txt.sh +++ b/dev/check-requirements-txt.sh @@ -24,8 +24,9 @@ cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/../ # Regenerate requirements.txt pip install pipreqs -for path in $(find . -type f -name '*pyproject*' | sed -E 's|/[^/]+$||' |sort -u) +for path in $(find ./examples -type f -name 'pyproject.toml' | sed -E 's|/[^/]+$||' |sort -u) do + echo $path pipreqs $path done From c16c7d870b7e68a96d8d059c4fbab85c224b5701 Mon Sep 17 00:00:00 2001 From: danielnugraha Date: Mon, 15 May 2023 16:14:34 +0200 Subject: [PATCH 03/27] generate requirements.txt --- examples/advanced_pytorch/requirements.txt | 3 +++ examples/advanced_tensorflow/requirements.txt | 2 ++ examples/android/requirements.txt | 1 + examples/dp-sgd-mnist/requirements.txt | 4 ++++ examples/ios/requirements.txt | 2 ++ examples/mt-pytorch/requirements.txt | 4 ++++ .../mxnet_from_centralized_to_federated/requirements.txt | 3 +++ examples/opacus/requirements.txt | 4 ++++ .../requirements.txt | 3 +++ .../pytorch_from_centralized_to_federated/requirements.txt | 4 ++++ examples/quickstart_fastai/requirements.txt | 3 +++ examples/quickstart_huggingface/requirements.txt | 6 ++++++ examples/quickstart_jax/requirements.txt | 4 ++++ examples/quickstart_mlcube/requirements.txt | 2 ++ examples/quickstart_mxnet/requirements.txt | 3 +++ examples/quickstart_pandas/requirements.txt | 3 +++ examples/quickstart_pytorch/requirements.txt | 4 ++++ examples/quickstart_pytorch_lightning/requirements.txt | 4 ++++ examples/quickstart_tabnet/requirements.txt | 4 ++++ examples/quickstart_tensorflow/requirements.txt | 2 ++ examples/simulation_tensorflow/requirements.txt | 2 ++ examples/sklearn-logreg-mnist/requirements.txt | 4 ++++ 22 files changed, 71 insertions(+) create mode 100644 examples/advanced_pytorch/requirements.txt create mode 100644 examples/advanced_tensorflow/requirements.txt create mode 100644 examples/android/requirements.txt create mode 100644 examples/dp-sgd-mnist/requirements.txt create mode 100644 examples/ios/requirements.txt create mode 100644 examples/mt-pytorch/requirements.txt create mode 100644 examples/mxnet_from_centralized_to_federated/requirements.txt create mode 100644 examples/opacus/requirements.txt create mode 100644 examples/pytorch_federated_variational_autoencoder/requirements.txt create mode 100644 examples/pytorch_from_centralized_to_federated/requirements.txt create mode 100644 examples/quickstart_fastai/requirements.txt create mode 100644 examples/quickstart_huggingface/requirements.txt create mode 100644 examples/quickstart_jax/requirements.txt create mode 100644 examples/quickstart_mlcube/requirements.txt create mode 100644 examples/quickstart_mxnet/requirements.txt create mode 100644 examples/quickstart_pandas/requirements.txt create mode 100644 examples/quickstart_pytorch/requirements.txt create mode 100644 examples/quickstart_pytorch_lightning/requirements.txt create mode 100644 examples/quickstart_tabnet/requirements.txt create mode 100644 examples/quickstart_tensorflow/requirements.txt create mode 100644 examples/simulation_tensorflow/requirements.txt create mode 100644 examples/sklearn-logreg-mnist/requirements.txt diff --git a/examples/advanced_pytorch/requirements.txt b/examples/advanced_pytorch/requirements.txt new file mode 100644 index 00000000000..64806144a28 --- /dev/null +++ b/examples/advanced_pytorch/requirements.txt @@ -0,0 +1,3 @@ +flwr==1.4.0 +torch==2.0.1 +torchvision==0.15.2 diff --git a/examples/advanced_tensorflow/requirements.txt b/examples/advanced_tensorflow/requirements.txt new file mode 100644 index 00000000000..ff24c57dda4 --- /dev/null +++ b/examples/advanced_tensorflow/requirements.txt @@ -0,0 +1,2 @@ +flwr==1.4.0 +tensorflow==2.12.0 diff --git a/examples/android/requirements.txt b/examples/android/requirements.txt new file mode 100644 index 00000000000..94cf9eb1a92 --- /dev/null +++ b/examples/android/requirements.txt @@ -0,0 +1 @@ +numpy==1.24.3 diff --git a/examples/dp-sgd-mnist/requirements.txt b/examples/dp-sgd-mnist/requirements.txt new file mode 100644 index 00000000000..5f74959ba5e --- /dev/null +++ b/examples/dp-sgd-mnist/requirements.txt @@ -0,0 +1,4 @@ +flwr==1.4.0 +numpy==1.24.3 +tensorflow==2.12.0 +tensorflow_privacy==0.8.9 diff --git a/examples/ios/requirements.txt b/examples/ios/requirements.txt new file mode 100644 index 00000000000..a0d0de12479 --- /dev/null +++ b/examples/ios/requirements.txt @@ -0,0 +1,2 @@ +flwr==1.4.0 +numpy==1.24.3 diff --git a/examples/mt-pytorch/requirements.txt b/examples/mt-pytorch/requirements.txt new file mode 100644 index 00000000000..849a465dd59 --- /dev/null +++ b/examples/mt-pytorch/requirements.txt @@ -0,0 +1,4 @@ +flwr==1.4.0 +torch==2.0.1 +torchvision==0.15.2 +tqdm==4.65.0 diff --git a/examples/mxnet_from_centralized_to_federated/requirements.txt b/examples/mxnet_from_centralized_to_federated/requirements.txt new file mode 100644 index 00000000000..463b0bdb570 --- /dev/null +++ b/examples/mxnet_from_centralized_to_federated/requirements.txt @@ -0,0 +1,3 @@ +flwr==1.4.0 +mxnet==1.9.1 +numpy==1.24.3 diff --git a/examples/opacus/requirements.txt b/examples/opacus/requirements.txt new file mode 100644 index 00000000000..986206426ce --- /dev/null +++ b/examples/opacus/requirements.txt @@ -0,0 +1,4 @@ +flwr==1.4.0 +numpy==1.24.3 +torch==2.0.1 +torchvision==0.15.2 diff --git a/examples/pytorch_federated_variational_autoencoder/requirements.txt b/examples/pytorch_federated_variational_autoencoder/requirements.txt new file mode 100644 index 00000000000..64806144a28 --- /dev/null +++ b/examples/pytorch_federated_variational_autoencoder/requirements.txt @@ -0,0 +1,3 @@ +flwr==1.4.0 +torch==2.0.1 +torchvision==0.15.2 diff --git a/examples/pytorch_from_centralized_to_federated/requirements.txt b/examples/pytorch_from_centralized_to_federated/requirements.txt new file mode 100644 index 00000000000..986206426ce --- /dev/null +++ b/examples/pytorch_from_centralized_to_federated/requirements.txt @@ -0,0 +1,4 @@ +flwr==1.4.0 +numpy==1.24.3 +torch==2.0.1 +torchvision==0.15.2 diff --git a/examples/quickstart_fastai/requirements.txt b/examples/quickstart_fastai/requirements.txt new file mode 100644 index 00000000000..f7fe1f72094 --- /dev/null +++ b/examples/quickstart_fastai/requirements.txt @@ -0,0 +1,3 @@ +fastai==2.7.12 +flwr==1.4.0 +torch==2.0.1 diff --git a/examples/quickstart_huggingface/requirements.txt b/examples/quickstart_huggingface/requirements.txt new file mode 100644 index 00000000000..60974c7e585 --- /dev/null +++ b/examples/quickstart_huggingface/requirements.txt @@ -0,0 +1,6 @@ +datasets==2.12.0 +evaluate==0.4.0 +flwr==1.4.0 +numpy==1.24.3 +torch==2.0.1 +transformers==4.29.1 diff --git a/examples/quickstart_jax/requirements.txt b/examples/quickstart_jax/requirements.txt new file mode 100644 index 00000000000..b660f4f4a1a --- /dev/null +++ b/examples/quickstart_jax/requirements.txt @@ -0,0 +1,4 @@ +flwr==1.4.0 +jax==0.4.10 +numpy==1.24.3 +scikit_learn==1.2.2 diff --git a/examples/quickstart_mlcube/requirements.txt b/examples/quickstart_mlcube/requirements.txt new file mode 100644 index 00000000000..ff24c57dda4 --- /dev/null +++ b/examples/quickstart_mlcube/requirements.txt @@ -0,0 +1,2 @@ +flwr==1.4.0 +tensorflow==2.12.0 diff --git a/examples/quickstart_mxnet/requirements.txt b/examples/quickstart_mxnet/requirements.txt new file mode 100644 index 00000000000..463b0bdb570 --- /dev/null +++ b/examples/quickstart_mxnet/requirements.txt @@ -0,0 +1,3 @@ +flwr==1.4.0 +mxnet==1.9.1 +numpy==1.24.3 diff --git a/examples/quickstart_pandas/requirements.txt b/examples/quickstart_pandas/requirements.txt new file mode 100644 index 00000000000..67919de54a3 --- /dev/null +++ b/examples/quickstart_pandas/requirements.txt @@ -0,0 +1,3 @@ +flwr==1.4.0 +numpy==1.24.3 +pandas==2.0.1 diff --git a/examples/quickstart_pytorch/requirements.txt b/examples/quickstart_pytorch/requirements.txt new file mode 100644 index 00000000000..3f115ce36bb --- /dev/null +++ b/examples/quickstart_pytorch/requirements.txt @@ -0,0 +1,4 @@ +flwr==1.4.0 ; python_version >= "3.7" and python_version < "4.0" +torch==1.12.1 ; python_version >= "3.7" and python_version < "4.0" +torchvision==0.13.1 ; python_version >= "3.7" and python_version < "4.0" +tqdm==4.65.0 ; python_version >= "3.7" and python_version < "4.0" diff --git a/examples/quickstart_pytorch_lightning/requirements.txt b/examples/quickstart_pytorch_lightning/requirements.txt new file mode 100644 index 00000000000..c06e9e2d351 --- /dev/null +++ b/examples/quickstart_pytorch_lightning/requirements.txt @@ -0,0 +1,4 @@ +flwr==1.4.0 +pytorch_lightning==2.0.2 +torch==2.0.1 +torchvision==0.15.2 diff --git a/examples/quickstart_tabnet/requirements.txt b/examples/quickstart_tabnet/requirements.txt new file mode 100644 index 00000000000..d6f6c579aa6 --- /dev/null +++ b/examples/quickstart_tabnet/requirements.txt @@ -0,0 +1,4 @@ +flwr==1.4.0 +tabnet==0.1.6 +tensorflow==2.12.0 +tensorflow_datasets==4.9.2 diff --git a/examples/quickstart_tensorflow/requirements.txt b/examples/quickstart_tensorflow/requirements.txt new file mode 100644 index 00000000000..ff24c57dda4 --- /dev/null +++ b/examples/quickstart_tensorflow/requirements.txt @@ -0,0 +1,2 @@ +flwr==1.4.0 +tensorflow==2.12.0 diff --git a/examples/simulation_tensorflow/requirements.txt b/examples/simulation_tensorflow/requirements.txt new file mode 100644 index 00000000000..ff24c57dda4 --- /dev/null +++ b/examples/simulation_tensorflow/requirements.txt @@ -0,0 +1,2 @@ +flwr==1.4.0 +tensorflow==2.12.0 diff --git a/examples/sklearn-logreg-mnist/requirements.txt b/examples/sklearn-logreg-mnist/requirements.txt new file mode 100644 index 00000000000..8d7712eee2a --- /dev/null +++ b/examples/sklearn-logreg-mnist/requirements.txt @@ -0,0 +1,4 @@ +flwr==1.4.0 +numpy==1.24.3 +openml==0.13.1 +scikit_learn==1.2.2 From 93f649e7373cc1701bb260418784da1e8cce4d43 Mon Sep 17 00:00:00 2001 From: danielnugraha Date: Mon, 15 May 2023 16:17:34 +0200 Subject: [PATCH 04/27] add check-requirements-txt to github workflows --- .github/workflows/flower.yml | 2 ++ dev/check-requirements-txt.sh | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/flower.yml b/.github/workflows/flower.yml index 5b1c25f62c4..1835a4e843c 100644 --- a/.github/workflows/flower.yml +++ b/.github/workflows/flower.yml @@ -33,5 +33,7 @@ jobs: run: python -m poetry install --extras "simulation" - name: Check if protos need recompilation run: ./dev/check-protos.sh + - name: Check if requirements.txt needs update + run: ./dev/check-requirements-txt.sh - name: Lint + Test (isort/black/docformatter/mypy/pylint/flake8/pytest) run: ./dev/test.sh diff --git a/dev/check-requirements-txt.sh b/dev/check-requirements-txt.sh index fd5ae79d687..5d49b93df65 100755 --- a/dev/check-requirements-txt.sh +++ b/dev/check-requirements-txt.sh @@ -30,8 +30,6 @@ do pipreqs $path done -pip uninstall pipreqs - # Fail if user forgot to recompile CHANGED=$(git diff --name-only HEAD examples) From 8481a8eb563fc2bbd264e87b04c557d1b39d5908 Mon Sep 17 00:00:00 2001 From: danielnugraha Date: Mon, 15 May 2023 16:36:53 +0200 Subject: [PATCH 05/27] separate generating from testing --- dev/generate-requirements-txt.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 dev/generate-requirements-txt.sh diff --git a/dev/generate-requirements-txt.sh b/dev/generate-requirements-txt.sh new file mode 100755 index 00000000000..72f79830acf --- /dev/null +++ b/dev/generate-requirements-txt.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +# Copyright 2023 Flower Labs GmbH. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================== + +set -e +cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/../ + +# Purpose of this script is to regenerate requirements.txt +pip install pipreqs + +for path in $(find ./examples -type f -name 'pyproject.toml' | sed -E 's|/[^/]+$||' |sort -u) +do + pipreqs --force $path +done From bef240990fa7b88274678691de997af9398c3c51 Mon Sep 17 00:00:00 2001 From: danielnugraha Date: Mon, 15 May 2023 16:37:46 +0200 Subject: [PATCH 06/27] separate generating from testing --- dev/check-requirements-txt.sh | 16 +++------------- examples/quickstart_pytorch/requirements.txt | 8 ++++---- examples/simulation_pytorch/requirements.txt | 9 ++++++--- 3 files changed, 13 insertions(+), 20 deletions(-) diff --git a/dev/check-requirements-txt.sh b/dev/check-requirements-txt.sh index 5d49b93df65..7c29e00afae 100755 --- a/dev/check-requirements-txt.sh +++ b/dev/check-requirements-txt.sh @@ -15,26 +15,16 @@ # limitations under the License. # ============================================================================== +./generate-requirements-txt.sh + set -e cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/../ -# Purpose of this script is to evaluate if the user changed the pyproject.toml definitions -# but did not regenerate or commit the new requirements.txt files - -# Regenerate requirements.txt -pip install pipreqs - -for path in $(find ./examples -type f -name 'pyproject.toml' | sed -E 's|/[^/]+$||' |sort -u) -do - echo $path - pipreqs $path -done - # Fail if user forgot to recompile CHANGED=$(git diff --name-only HEAD examples) if [ -n "$CHANGED" ]; then - echo "Changes detected" + echo "Changes detected, please run the script dev/generate-requirements-txt" exit 1 fi diff --git a/examples/quickstart_pytorch/requirements.txt b/examples/quickstart_pytorch/requirements.txt index 3f115ce36bb..849a465dd59 100644 --- a/examples/quickstart_pytorch/requirements.txt +++ b/examples/quickstart_pytorch/requirements.txt @@ -1,4 +1,4 @@ -flwr==1.4.0 ; python_version >= "3.7" and python_version < "4.0" -torch==1.12.1 ; python_version >= "3.7" and python_version < "4.0" -torchvision==0.13.1 ; python_version >= "3.7" and python_version < "4.0" -tqdm==4.65.0 ; python_version >= "3.7" and python_version < "4.0" +flwr==1.4.0 +torch==2.0.1 +torchvision==0.15.2 +tqdm==4.65.0 diff --git a/examples/simulation_pytorch/requirements.txt b/examples/simulation_pytorch/requirements.txt index 94b66e4a454..8aed4730374 100644 --- a/examples/simulation_pytorch/requirements.txt +++ b/examples/simulation_pytorch/requirements.txt @@ -1,3 +1,6 @@ -flwr==1.0.0 -torch==1.12.0 -torchvision==0.13.0 +flwr==1.4.0 +numpy==1.24.3 +Pillow==9.5.0 +ray==2.4.0 +torch==2.0.1 +torchvision==0.15.2 From d99700e523e74c001bb4772aa596027c631022ce Mon Sep 17 00:00:00 2001 From: danielnugraha Date: Tue, 16 May 2023 13:49:11 +0200 Subject: [PATCH 07/27] add pipreqs to dev dependency --- dev/check-requirements-txt.sh | 4 ++-- dev/generate-requirements-txt.sh | 4 +--- pyproject.toml | 1 + 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/dev/check-requirements-txt.sh b/dev/check-requirements-txt.sh index 7c29e00afae..a9c22ebc860 100755 --- a/dev/check-requirements-txt.sh +++ b/dev/check-requirements-txt.sh @@ -20,11 +20,11 @@ set -e cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/../ -# Fail if user forgot to recompile +# Fail if user forgot to sync requirements.txt and pyproject.toml CHANGED=$(git diff --name-only HEAD examples) if [ -n "$CHANGED" ]; then - echo "Changes detected, please run the script dev/generate-requirements-txt" + echo "Changes detected, requirements.txt and pyproject.toml is not synced. Please run the script dev/generate-requirements-txt." exit 1 fi diff --git a/dev/generate-requirements-txt.sh b/dev/generate-requirements-txt.sh index 72f79830acf..2b509e516d0 100755 --- a/dev/generate-requirements-txt.sh +++ b/dev/generate-requirements-txt.sh @@ -19,9 +19,7 @@ set -e cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/../ # Purpose of this script is to regenerate requirements.txt -pip install pipreqs - for path in $(find ./examples -type f -name 'pyproject.toml' | sed -E 's|/[^/]+$||' |sort -u) do - pipreqs --force $path + pipreqs --mode 'compat' --force $path done diff --git a/pyproject.toml b/pyproject.toml index ae656446d8c..698d1d670f5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -99,6 +99,7 @@ sphinx-reredirects = "==0.1.1" nbsphinx = "==0.8.12" nbstripout = "==0.6.1" sphinx-argparse = "==0.4.0" +pipreqs = "==0.4.13" [tool.isort] line_length = 88 From 752da8d421650f77f672aea37462f9bff83be6e7 Mon Sep 17 00:00:00 2001 From: danielnugraha Date: Tue, 16 May 2023 13:52:28 +0200 Subject: [PATCH 08/27] regenerate requirements.txt to mode compat --- examples/advanced_pytorch/requirements.txt | 6 +++--- examples/advanced_tensorflow/requirements.txt | 4 ++-- examples/android/requirements.txt | 2 +- examples/dp-sgd-mnist/requirements.txt | 8 ++++---- examples/ios/requirements.txt | 4 ++-- examples/mt-pytorch/requirements.txt | 8 ++++---- .../requirements.txt | 6 +++--- examples/opacus/requirements.txt | 8 ++++---- .../requirements.txt | 6 +++--- .../requirements.txt | 8 ++++---- examples/quickstart_fastai/requirements.txt | 6 +++--- examples/quickstart_huggingface/requirements.txt | 12 ++++++------ examples/quickstart_jax/requirements.txt | 8 ++++---- examples/quickstart_mlcube/requirements.txt | 4 ++-- examples/quickstart_mxnet/requirements.txt | 6 +++--- examples/quickstart_pandas/requirements.txt | 6 +++--- examples/quickstart_pytorch/requirements.txt | 8 ++++---- .../quickstart_pytorch_lightning/requirements.txt | 8 ++++---- examples/quickstart_tabnet/requirements.txt | 8 ++++---- examples/quickstart_tensorflow/requirements.txt | 4 ++-- examples/simulation_pytorch/requirements.txt | 12 ++++++------ examples/simulation_tensorflow/requirements.txt | 4 ++-- examples/sklearn-logreg-mnist/requirements.txt | 8 ++++---- 23 files changed, 77 insertions(+), 77 deletions(-) diff --git a/examples/advanced_pytorch/requirements.txt b/examples/advanced_pytorch/requirements.txt index 64806144a28..5a348e91470 100644 --- a/examples/advanced_pytorch/requirements.txt +++ b/examples/advanced_pytorch/requirements.txt @@ -1,3 +1,3 @@ -flwr==1.4.0 -torch==2.0.1 -torchvision==0.15.2 +flwr~=1.4.0 +torch~=2.0.1 +torchvision~=0.15.2 diff --git a/examples/advanced_tensorflow/requirements.txt b/examples/advanced_tensorflow/requirements.txt index ff24c57dda4..feccc7cc874 100644 --- a/examples/advanced_tensorflow/requirements.txt +++ b/examples/advanced_tensorflow/requirements.txt @@ -1,2 +1,2 @@ -flwr==1.4.0 -tensorflow==2.12.0 +flwr~=1.4.0 +tensorflow~=2.12.0 diff --git a/examples/android/requirements.txt b/examples/android/requirements.txt index 94cf9eb1a92..e75049b33f0 100644 --- a/examples/android/requirements.txt +++ b/examples/android/requirements.txt @@ -1 +1 @@ -numpy==1.24.3 +numpy~=1.21.1 diff --git a/examples/dp-sgd-mnist/requirements.txt b/examples/dp-sgd-mnist/requirements.txt index 5f74959ba5e..fa51400e9e0 100644 --- a/examples/dp-sgd-mnist/requirements.txt +++ b/examples/dp-sgd-mnist/requirements.txt @@ -1,4 +1,4 @@ -flwr==1.4.0 -numpy==1.24.3 -tensorflow==2.12.0 -tensorflow_privacy==0.8.9 +flwr~=1.4.0 +numpy~=1.21.1 +tensorflow~=2.12.0 +tensorflow_privacy~=0.8.9 diff --git a/examples/ios/requirements.txt b/examples/ios/requirements.txt index a0d0de12479..9d6b364ee36 100644 --- a/examples/ios/requirements.txt +++ b/examples/ios/requirements.txt @@ -1,2 +1,2 @@ -flwr==1.4.0 -numpy==1.24.3 +flwr~=1.4.0 +numpy~=1.21.1 diff --git a/examples/mt-pytorch/requirements.txt b/examples/mt-pytorch/requirements.txt index 849a465dd59..49d95d299b3 100644 --- a/examples/mt-pytorch/requirements.txt +++ b/examples/mt-pytorch/requirements.txt @@ -1,4 +1,4 @@ -flwr==1.4.0 -torch==2.0.1 -torchvision==0.15.2 -tqdm==4.65.0 +flwr~=1.4.0 +torch~=2.0.1 +torchvision~=0.15.2 +tqdm~=4.65.0 diff --git a/examples/mxnet_from_centralized_to_federated/requirements.txt b/examples/mxnet_from_centralized_to_federated/requirements.txt index 463b0bdb570..4865e949538 100644 --- a/examples/mxnet_from_centralized_to_federated/requirements.txt +++ b/examples/mxnet_from_centralized_to_federated/requirements.txt @@ -1,3 +1,3 @@ -flwr==1.4.0 -mxnet==1.9.1 -numpy==1.24.3 +flwr~=1.4.0 +mxnet~=1.9.1 +numpy~=1.21.1 diff --git a/examples/opacus/requirements.txt b/examples/opacus/requirements.txt index 986206426ce..e6e5dbb2fdf 100644 --- a/examples/opacus/requirements.txt +++ b/examples/opacus/requirements.txt @@ -1,4 +1,4 @@ -flwr==1.4.0 -numpy==1.24.3 -torch==2.0.1 -torchvision==0.15.2 +flwr~=1.4.0 +numpy~=1.21.1 +torch~=2.0.1 +torchvision~=0.15.2 diff --git a/examples/pytorch_federated_variational_autoencoder/requirements.txt b/examples/pytorch_federated_variational_autoencoder/requirements.txt index 64806144a28..5a348e91470 100644 --- a/examples/pytorch_federated_variational_autoencoder/requirements.txt +++ b/examples/pytorch_federated_variational_autoencoder/requirements.txt @@ -1,3 +1,3 @@ -flwr==1.4.0 -torch==2.0.1 -torchvision==0.15.2 +flwr~=1.4.0 +torch~=2.0.1 +torchvision~=0.15.2 diff --git a/examples/pytorch_from_centralized_to_federated/requirements.txt b/examples/pytorch_from_centralized_to_federated/requirements.txt index 986206426ce..e6e5dbb2fdf 100644 --- a/examples/pytorch_from_centralized_to_federated/requirements.txt +++ b/examples/pytorch_from_centralized_to_federated/requirements.txt @@ -1,4 +1,4 @@ -flwr==1.4.0 -numpy==1.24.3 -torch==2.0.1 -torchvision==0.15.2 +flwr~=1.4.0 +numpy~=1.21.1 +torch~=2.0.1 +torchvision~=0.15.2 diff --git a/examples/quickstart_fastai/requirements.txt b/examples/quickstart_fastai/requirements.txt index f7fe1f72094..0a7f315018a 100644 --- a/examples/quickstart_fastai/requirements.txt +++ b/examples/quickstart_fastai/requirements.txt @@ -1,3 +1,3 @@ -fastai==2.7.12 -flwr==1.4.0 -torch==2.0.1 +fastai~=2.7.12 +flwr~=1.4.0 +torch~=2.0.1 diff --git a/examples/quickstart_huggingface/requirements.txt b/examples/quickstart_huggingface/requirements.txt index 60974c7e585..767eefed80b 100644 --- a/examples/quickstart_huggingface/requirements.txt +++ b/examples/quickstart_huggingface/requirements.txt @@ -1,6 +1,6 @@ -datasets==2.12.0 -evaluate==0.4.0 -flwr==1.4.0 -numpy==1.24.3 -torch==2.0.1 -transformers==4.29.1 +datasets~=2.12.0 +evaluate~=0.4.0 +flwr~=1.4.0 +numpy~=1.21.1 +torch~=2.0.1 +transformers~=4.29.1 diff --git a/examples/quickstart_jax/requirements.txt b/examples/quickstart_jax/requirements.txt index b660f4f4a1a..bf7a9c64d66 100644 --- a/examples/quickstart_jax/requirements.txt +++ b/examples/quickstart_jax/requirements.txt @@ -1,4 +1,4 @@ -flwr==1.4.0 -jax==0.4.10 -numpy==1.24.3 -scikit_learn==1.2.2 +flwr~=1.4.0 +jax~=0.4.10 +numpy~=1.21.1 +scikit_learn~=1.2.2 diff --git a/examples/quickstart_mlcube/requirements.txt b/examples/quickstart_mlcube/requirements.txt index ff24c57dda4..feccc7cc874 100644 --- a/examples/quickstart_mlcube/requirements.txt +++ b/examples/quickstart_mlcube/requirements.txt @@ -1,2 +1,2 @@ -flwr==1.4.0 -tensorflow==2.12.0 +flwr~=1.4.0 +tensorflow~=2.12.0 diff --git a/examples/quickstart_mxnet/requirements.txt b/examples/quickstart_mxnet/requirements.txt index 463b0bdb570..4865e949538 100644 --- a/examples/quickstart_mxnet/requirements.txt +++ b/examples/quickstart_mxnet/requirements.txt @@ -1,3 +1,3 @@ -flwr==1.4.0 -mxnet==1.9.1 -numpy==1.24.3 +flwr~=1.4.0 +mxnet~=1.9.1 +numpy~=1.21.1 diff --git a/examples/quickstart_pandas/requirements.txt b/examples/quickstart_pandas/requirements.txt index 67919de54a3..994eed4fac0 100644 --- a/examples/quickstart_pandas/requirements.txt +++ b/examples/quickstart_pandas/requirements.txt @@ -1,3 +1,3 @@ -flwr==1.4.0 -numpy==1.24.3 -pandas==2.0.1 +flwr~=1.4.0 +numpy~=1.21.1 +pandas~=2.0.1 diff --git a/examples/quickstart_pytorch/requirements.txt b/examples/quickstart_pytorch/requirements.txt index 849a465dd59..49d95d299b3 100644 --- a/examples/quickstart_pytorch/requirements.txt +++ b/examples/quickstart_pytorch/requirements.txt @@ -1,4 +1,4 @@ -flwr==1.4.0 -torch==2.0.1 -torchvision==0.15.2 -tqdm==4.65.0 +flwr~=1.4.0 +torch~=2.0.1 +torchvision~=0.15.2 +tqdm~=4.65.0 diff --git a/examples/quickstart_pytorch_lightning/requirements.txt b/examples/quickstart_pytorch_lightning/requirements.txt index c06e9e2d351..dfa386908d6 100644 --- a/examples/quickstart_pytorch_lightning/requirements.txt +++ b/examples/quickstart_pytorch_lightning/requirements.txt @@ -1,4 +1,4 @@ -flwr==1.4.0 -pytorch_lightning==2.0.2 -torch==2.0.1 -torchvision==0.15.2 +flwr~=1.4.0 +pytorch_lightning~=2.0.2 +torch~=2.0.1 +torchvision~=0.15.2 diff --git a/examples/quickstart_tabnet/requirements.txt b/examples/quickstart_tabnet/requirements.txt index d6f6c579aa6..4ebf6eafcbe 100644 --- a/examples/quickstart_tabnet/requirements.txt +++ b/examples/quickstart_tabnet/requirements.txt @@ -1,4 +1,4 @@ -flwr==1.4.0 -tabnet==0.1.6 -tensorflow==2.12.0 -tensorflow_datasets==4.9.2 +flwr~=1.4.0 +tabnet~=0.1.6 +tensorflow~=2.12.0 +tensorflow_datasets~=4.9.2 diff --git a/examples/quickstart_tensorflow/requirements.txt b/examples/quickstart_tensorflow/requirements.txt index ff24c57dda4..feccc7cc874 100644 --- a/examples/quickstart_tensorflow/requirements.txt +++ b/examples/quickstart_tensorflow/requirements.txt @@ -1,2 +1,2 @@ -flwr==1.4.0 -tensorflow==2.12.0 +flwr~=1.4.0 +tensorflow~=2.12.0 diff --git a/examples/simulation_pytorch/requirements.txt b/examples/simulation_pytorch/requirements.txt index 8aed4730374..650b902c918 100644 --- a/examples/simulation_pytorch/requirements.txt +++ b/examples/simulation_pytorch/requirements.txt @@ -1,6 +1,6 @@ -flwr==1.4.0 -numpy==1.24.3 -Pillow==9.5.0 -ray==2.4.0 -torch==2.0.1 -torchvision==0.15.2 +flwr~=1.4.0 +numpy~=1.21.1 +Pillow~=9.5.0 +ray~=2.4.0 +torch~=2.0.1 +torchvision~=0.15.2 diff --git a/examples/simulation_tensorflow/requirements.txt b/examples/simulation_tensorflow/requirements.txt index ff24c57dda4..feccc7cc874 100644 --- a/examples/simulation_tensorflow/requirements.txt +++ b/examples/simulation_tensorflow/requirements.txt @@ -1,2 +1,2 @@ -flwr==1.4.0 -tensorflow==2.12.0 +flwr~=1.4.0 +tensorflow~=2.12.0 diff --git a/examples/sklearn-logreg-mnist/requirements.txt b/examples/sklearn-logreg-mnist/requirements.txt index 8d7712eee2a..eec2e1a3c4b 100644 --- a/examples/sklearn-logreg-mnist/requirements.txt +++ b/examples/sklearn-logreg-mnist/requirements.txt @@ -1,4 +1,4 @@ -flwr==1.4.0 -numpy==1.24.3 -openml==0.13.1 -scikit_learn==1.2.2 +flwr~=1.4.0 +numpy~=1.21.1 +openml~=0.13.1 +scikit_learn~=1.2.2 From 33478b3f9102d4dee17c7c54f7ebe7e45a44080c Mon Sep 17 00:00:00 2001 From: "Daniel J. Beutel" Date: Tue, 16 May 2023 13:58:56 +0200 Subject: [PATCH 09/27] Update .github/workflows/flower.yml --- .github/workflows/flower.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flower.yml b/.github/workflows/flower.yml index 1835a4e843c..6a407107fc6 100644 --- a/.github/workflows/flower.yml +++ b/.github/workflows/flower.yml @@ -33,7 +33,7 @@ jobs: run: python -m poetry install --extras "simulation" - name: Check if protos need recompilation run: ./dev/check-protos.sh - - name: Check if requirements.txt needs update + - name: Check if example requirements.txt files need regeneration run: ./dev/check-requirements-txt.sh - name: Lint + Test (isort/black/docformatter/mypy/pylint/flake8/pytest) run: ./dev/test.sh From 5a9a35eb282e1ec6d05ae9017a08abe676b8fc22 Mon Sep 17 00:00:00 2001 From: danielnugraha Date: Wed, 17 May 2023 11:25:48 +0200 Subject: [PATCH 10/27] add requirements.txt description to readme.md --- examples/advanced_pytorch/README.md | 12 ++++++++- examples/advanced_tensorflow/README.md | 10 +++++++- examples/android/README.md | 10 +++++++- examples/dp-sgd-mnist/README.md | 12 +++++++-- .../README.md | 13 ++++++++-- .../README.md | 12 ++++++++- .../README.md | 13 ++++++++-- examples/quickstart_fastai/README.md | 15 ++++++++--- examples/quickstart_huggingface/README.md | 13 ++++++++-- examples/quickstart_jax/README.md | 13 ++++++++-- examples/quickstart_mxnet/README.md | 13 ++++++++-- examples/quickstart_pandas/README.md | 25 +++++++++++++------ examples/quickstart_pytorch/README.md | 15 ++++++++--- examples/quickstart_tabnet/README.md | 13 ++++++++-- examples/quickstart_tensorflow/README.md | 11 +++++++- examples/sklearn-logreg-mnist/README.md | 12 +++++++-- 16 files changed, 177 insertions(+), 35 deletions(-) diff --git a/examples/advanced_pytorch/README.md b/examples/advanced_pytorch/README.md index 5124c5ec7dc..e278957509b 100644 --- a/examples/advanced_pytorch/README.md +++ b/examples/advanced_pytorch/README.md @@ -21,14 +21,17 @@ This will create a new directory called `advanced_pytorch` containing the follow ```shell -- pyproject.toml +-- requirements.txt -- client.py -- server.py -- README.md -- run.sh ``` -Project dependencies (such as `pytorch` and `flwr`) are defined in `pyproject.toml`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +### Installing Dependencies +Project dependencies (such as `torch` and `flwr`) are defined in `pyproject.toml` and 'requirements.txt'. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +#### Poetry ```shell poetry install poetry shell @@ -42,6 +45,13 @@ poetry run python3 -c "import flwr" If you don't see any errors you're good to go! +#### Pip +Write the command below in your terminal to install the dependencies according to the configuration file requirements.txt. +```shell +pip install -r requirements.txt +``` + + # Run Federated Learning with PyTorch and Flower The included `run.sh` will start the Flower server (using `server.py`), diff --git a/examples/advanced_tensorflow/README.md b/examples/advanced_tensorflow/README.md index c7c6771f06c..a031a66ffaf 100644 --- a/examples/advanced_tensorflow/README.md +++ b/examples/advanced_tensorflow/README.md @@ -27,8 +27,10 @@ This will create a new directory called `advanced_tensorflow` containing the fol -- run.sh ``` -Project dependencies (such as `tensorflow` and `flwr`) are defined in `pyproject.toml`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +### Installing Dependencies +Project dependencies (such as `tensorflow` and `flwr`) are defined in `pyproject.toml` and 'requirements.txt'. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +#### Poetry ```shell poetry install poetry shell @@ -42,6 +44,12 @@ poetry run python3 -c "import flwr" If you don't see any errors you're good to go! +#### Pip +Write the command below in your terminal to install the dependencies according to the configuration file requirements.txt. +```shell +pip install -r requirements.txt +``` + ## Run Federated Learning with TensorFlow/Keras and Flower The included `run.sh` will call a script to generate certificates (which will be used by server and clients), start the Flower server (using `server.py`), sleep for 2 seconds to ensure the the server is up, and then start 10 Flower clients (using `client.py`). You can simply start everything in a terminal as follows: diff --git a/examples/android/README.md b/examples/android/README.md index 7ef19c86862..581c51e366d 100644 --- a/examples/android/README.md +++ b/examples/android/README.md @@ -16,8 +16,10 @@ Start by cloning the example project. We prepared a single-line command that you git clone --depth=1 https://github.com/adap/flower.git && mv flower/examples/android . && rm -rf flower && cd android ``` -Project dependencies (such as `tensorflow` and `flwr`) are defined in `pyproject.toml`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +### Installing Dependencies +Project dependencies (such as `tensorflow` and `flwr`) are defined in `pyproject.toml` and 'requirements.txt'. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +#### Poetry ```shell poetry install poetry shell @@ -31,6 +33,12 @@ poetry run python3 -c "import flwr" If you don't see any errors you're good to go! +#### Pip +Write the command below in your terminal to install the dependencies according to the configuration file requirements.txt. +```shell +pip install -r requirements.txt +``` + # Run Federated Learning on Android Devices The included `run.sh` will start the Flower server (using `server.py`). You can simply start it in a terminal as follows: diff --git a/examples/dp-sgd-mnist/README.md b/examples/dp-sgd-mnist/README.md index e6276e06ab1..9c2468d3ec6 100644 --- a/examples/dp-sgd-mnist/README.md +++ b/examples/dp-sgd-mnist/README.md @@ -18,14 +18,16 @@ This will create a new directory called `dp-sgd-mnist` containing the following ```shell -- pyproject.toml +-- requirements.txt -- client.py -- server.py -- common.py -- README.md ``` +### Installing Dependencies +Project dependencies (such as `tensorflow` and `tensorflow-privacy`) are defined in `pyproject.toml` and 'requirements.txt'. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. -Project dependencies (such as `tensorflow` and `tensorflow-privacy`) are defined in `pyproject.toml`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. - +#### Poetry ```shell poetry install poetry shell @@ -39,6 +41,12 @@ poetry run python3 -c "import flwr" If you don't see any errors you're good to go! +#### Pip +Write the command below in your terminal to install the dependencies according to the configuration file requirements.txt. +```shell +pip install -r requirements.txt +``` + # Run Federated Learning with TensorFlow/Keras/Tensorflow-Privacy and Flower Afterwards you are ready to start the Flower server as well as the clients. You can simply start the server in a terminal as follows: diff --git a/examples/mxnet_from_centralized_to_federated/README.md b/examples/mxnet_from_centralized_to_federated/README.md index 0ab069d30b3..fcf65a2044e 100644 --- a/examples/mxnet_from_centralized_to_federated/README.md +++ b/examples/mxnet_from_centralized_to_federated/README.md @@ -16,14 +16,17 @@ This will create a new directory called `mxnet_from_centralized_to_federated` co ```shell -- pyproject.toml +-- requirements.txt -- mxnet_mnist.py -- client.py -- server.py -- README.md ``` -Project dependencies (such as `mxnet` and `flwr`) are defined in `pyproject.toml`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +### Installing Dependencies +Project dependencies (such as `mxnet` and `flwr`) are defined in `pyproject.toml` and 'requirements.txt'. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +#### Poetry ```shell poetry install poetry shell @@ -32,11 +35,17 @@ poetry shell Poetry will install all your dependencies in a newly created virtual environment. To verify that everything works correctly you can run the following command: ```shell -python3 -c "import flwr" +poetry run python3 -c "import flwr" ``` If you don't see any errors you're good to go! +#### Pip +Write the command below in your terminal to install the dependencies according to the configuration file requirements.txt. +```shell +pip install -r requirements.txt +``` + ## Run MXNet Federated This MXNet example is based on the [Handwritten Digit Recognition](https://mxnet.apache.org/versions/1.7.0/api/python/docs/tutorials/packages/gluon/image/mnist.html) tutorial and uses the MNIST dataset (hand-written digits with 28x28 pixels in greyscale with 10 classes). Feel free to consult the tutorial if you want to get a better understanding of MXNet. The file `mxnet_mnist.py` contains all the steps that are described in the tutorial. It loads the dataset and a sequential model, trains the model with the training set, and evaluates the trained model on the test set. diff --git a/examples/pytorch_federated_variational_autoencoder/README.md b/examples/pytorch_federated_variational_autoencoder/README.md index 2343b4d7082..180603bd408 100644 --- a/examples/pytorch_federated_variational_autoencoder/README.md +++ b/examples/pytorch_federated_variational_autoencoder/README.md @@ -13,16 +13,20 @@ This will create a new directory called `pytorch_federated_variational_autoencod ```shell -- pyproject.toml +-- requirements.txt -- client.py -- server.py -- README.md -- models.py ``` -Project dependencies (such as `torch` and `flwr`) are defined in `pyproject.toml`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +### Installing Dependencies +Project dependencies (such as `torch` and `flwr`) are defined in `pyproject.toml` and 'requirements.txt'. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +#### Poetry ```shell poetry install +poetry shell ``` Poetry will install all your dependencies in a newly created virtual environment. To verify that everything works correctly you can run the following command: @@ -33,6 +37,12 @@ poetry run python3 -c "import flwr" If you don't see any errors you're good to go! +#### Pip +Write the command below in your terminal to install the dependencies according to the configuration file requirements.txt. +```shell +pip install -r requirements.txt +``` + ## Federating the Variational Autoencoder Model Afterwards you are ready to start the Flower server as well as the clients. You can simply start the server in a terminal as follows: diff --git a/examples/pytorch_from_centralized_to_federated/README.md b/examples/pytorch_from_centralized_to_federated/README.md index 048d137d78d..2a1a2c02816 100644 --- a/examples/pytorch_from_centralized_to_federated/README.md +++ b/examples/pytorch_from_centralized_to_federated/README.md @@ -16,14 +16,17 @@ This will create a new directory called `pytorch_from_centralized_to_federated` ```shell -- pyproject.toml +-- requirements.txt -- cifar.py -- client.py -- server.py -- README.md ``` -Project dependencies (such as `torch` and `flwr`) are defined in `pyproject.toml`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +### Installing Dependencies +Project dependencies (such as `torch` and `flwr`) are defined in `pyproject.toml` and 'requirements.txt'. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +#### Poetry ```shell poetry install poetry shell @@ -32,11 +35,17 @@ poetry shell Poetry will install all your dependencies in a newly created virtual environment. To verify that everything works correctly you can run the following command: ```shell -python3 -c "import flwr" +poetry run python3 -c "import flwr" ``` If you don't see any errors you're good to go! +#### Pip +Write the command below in your terminal to install the dependencies according to the configuration file requirements.txt. +```shell +pip install -r requirements.txt +``` + ## From Centralized To Federated This PyTorch example is based on the [Deep Learning with PyTorch](https://pytorch.org/tutorials/beginner/blitz/cifar10_tutorial.html) tutorial and uses the CIFAR-10 dataset (a RGB image classification task). Feel free to consult the tutorial if you want to get a better understanding of PyTorch. The file `cifar.py` contains all the steps that are described in the tutorial. It loads the dataset, trains a convolutional neural network (CNN) on the training set, and evaluates the trained model on the test set. diff --git a/examples/quickstart_fastai/README.md b/examples/quickstart_fastai/README.md index 4021fba03ba..2c931a8f30b 100644 --- a/examples/quickstart_fastai/README.md +++ b/examples/quickstart_fastai/README.md @@ -15,27 +15,36 @@ This will create a new directory called `quickstart_fastai` containing the follo ```shell -- pyproject.toml +-- requirements.txt -- client.py -- server.py -- run.sh -- README.md ``` -Project dependencies (such as `fastai` and `flwr`) are defined in `pyproject.toml`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +### Installing Dependencies +Project dependencies (such as `fastai` and `flwr`) are defined in `pyproject.toml` and 'requirements.txt'. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +#### Poetry ```shell poetry install poetry shell ``` -To verify that everything works correctly you can run the following command: +Poetry will install all your dependencies in a newly created virtual environment. To verify that everything works correctly you can run the following command: ```shell -python3 -c "import flwr" +poetry run python3 -c "import flwr" ``` If you don't see any errors you're good to go! +#### Pip +Write the command below in your terminal to install the dependencies according to the configuration file requirements.txt. +```shell +pip install -r requirements.txt +``` + # Run Federated Learning with fastai and Flower Afterwards you are ready to start the Flower server as well as the clients. You can simply start the server in a terminal as follows: diff --git a/examples/quickstart_huggingface/README.md b/examples/quickstart_huggingface/README.md index 518e2deaa1d..fb0b4ad106d 100644 --- a/examples/quickstart_huggingface/README.md +++ b/examples/quickstart_huggingface/README.md @@ -16,13 +16,16 @@ This will create a new directory called `quickstart_huggingface` containing the ```shell -- pyproject.toml +-- requirements.txt -- client.py -- server.py -- README.md ``` -Project dependencies (such as `torch` and `flwr`) are defined in `pyproject.toml`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +### Installing Dependencies +Project dependencies (such as `torch` and `flwr`) are defined in `pyproject.toml` and 'requirements.txt'. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +#### Poetry ```shell poetry install poetry shell @@ -31,11 +34,17 @@ poetry shell Poetry will install all your dependencies in a newly created virtual environment. To verify that everything works correctly you can run the following command: ```shell -python3 -c "import flwr" +poetry run python3 -c "import flwr" ``` If you don't see any errors you're good to go! +#### Pip +Write the command below in your terminal to install the dependencies according to the configuration file requirements.txt. +```shell +pip install -r requirements.txt +``` + # Run Federated Learning with Flower Afterwards you are ready to start the Flower server as well as the clients. You can simply start the server in a terminal as follows: diff --git a/examples/quickstart_jax/README.md b/examples/quickstart_jax/README.md index 07318c50e13..febb2bb4676 100644 --- a/examples/quickstart_jax/README.md +++ b/examples/quickstart_jax/README.md @@ -16,14 +16,17 @@ This will create a new directory called `quickstart_jax`, containing the followi ```shell -- pyproject.toml +-- requirements.txt -- jax_training.py -- client.py -- server.py -- README.md ``` -Project dependencies (such as `jax` and `flwr`) are defined in `pyproject.toml`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +### Installing Dependencies +Project dependencies (such as `jax` and `flwr`) are defined in `pyproject.toml` and 'requirements.txt'. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +#### Poetry ```shell poetry install poetry shell @@ -32,11 +35,17 @@ poetry shell Poetry will install all your dependencies in a newly created virtual environment. To verify that everything works correctly you can run the following command: ```shell -python3 -c "import flwr" +poetry run python3 -c "import flwr" ``` If you don't see any errors you're good to go! +#### Pip +Write the command below in your terminal to install the dependencies according to the configuration file requirements.txt. +```shell +pip install -r requirements.txt +``` + ## Run JAX Federated This JAX example is based on the [Linear Regression with JAX](https://coax.readthedocs.io/en/latest/examples/linear_regression/jax.html) tutorial and uses a sklearn dataset (generating a random dataset for a regression pronlem). Feel free to consult the tutorial if you want to get a better understanding of JAX. If you play around with the dataset, please keep in mind that the data samples are generated randomly depending on the settings being done while calling the dataset function. Please checkout out the [scikit-learn tutorial for further information](https://scikit-learn.org/stable/modules/generated/sklearn.datasets.make_regression.html). The file `jax_training.py` contains all the steps that are described in the tutorial. It loads the train and test dataset and a linear regression model, trains the model with the training set, and evaluates the trained model on the test set. diff --git a/examples/quickstart_mxnet/README.md b/examples/quickstart_mxnet/README.md index 993e0d53ca7..226b96485b9 100644 --- a/examples/quickstart_mxnet/README.md +++ b/examples/quickstart_mxnet/README.md @@ -16,13 +16,16 @@ This will create a new directory called `quickstart_mxnet` containing the follow ```shell -- pyproject.toml +-- requirements.txt -- client.py -- server.py -- README.md ``` -Project dependencies (such as `mxnet` and `flwr`) are defined in `pyproject.toml`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +### Installing Dependencies +Project dependencies (such as `mxnet` and `flwr`) are defined in `pyproject.toml` and 'requirements.txt'. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +#### Poetry ```shell poetry install poetry shell @@ -31,11 +34,17 @@ poetry shell Poetry will install all your dependencies in a newly created virtual environment. To verify that everything works correctly you can run the following command: ```shell -python3 -c "import flwr" +poetry run python3 -c "import flwr" ``` If you don't see any errors you're good to go! +#### Pip +Write the command below in your terminal to install the dependencies according to the configuration file requirements.txt. +```shell +pip install -r requirements.txt +``` + ## Run MXNet Federated This MXNet example is based on the [Handwritten Digit Recognition](https://mxnet.apache.org/versions/1.7.0/api/python/docs/tutorials/packages/gluon/image/mnist.html) tutorial and uses the MNIST dataset (hand-written digits with 28x28 pixels in greyscale with 10 classes). Feel free to consult the tutorial if you want to get a better understanding of MXNet. The file `client.py` contains all the steps that are described in the tutorial. It loads the dataset and a sequential model, trains the model with the training set, and evaluates the trained model on the test set. diff --git a/examples/quickstart_pandas/README.md b/examples/quickstart_pandas/README.md index bde0652fb78..e7023322b10 100644 --- a/examples/quickstart_pandas/README.md +++ b/examples/quickstart_pandas/README.md @@ -15,32 +15,41 @@ This will create a new directory called `quickstart_pandas` containing the follo ```shell -- pyproject.toml +-- requirements.txt -- client.py -- server.py -- start.sh -- README.md ``` -Project dependencies (such as `pandas` and `flwr`) are defined in `pyproject.toml`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +If you don't plan on using the `run.sh` script that automates the run, you should first download the data and put it in a `data` folder, this can be done by executing: ```shell -$ poetry install -$ poetry shell +$ mkdir -p ./data +$ python -c "from sklearn.datasets import load_iris; load_iris(as_frame=True)['data'].to_csv('./data/client.csv')" +``` + +### Installing Dependencies +Project dependencies (such as `pandas` and `flwr`) are defined in `pyproject.toml` and 'requirements.txt'. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. + +#### Poetry +```shell +poetry install +poetry shell ``` Poetry will install all your dependencies in a newly created virtual environment. To verify that everything works correctly you can run the following command: ```shell -$ python3 -c "import flwr" +poetry run python3 -c "import flwr" ``` If you don't see any errors you're good to go! -If you don't plan on using the `run.sh` script that automates the run, you should first download the data and put it in a `data` folder, this can be done by executing: - +#### Pip +Write the command below in your terminal to install the dependencies according to the configuration file requirements.txt. ```shell -$ mkdir -p ./data -$ python -c "from sklearn.datasets import load_iris; load_iris(as_frame=True)['data'].to_csv('./data/client.csv')" +pip install -r requirements.txt ``` # Run Federated Analytics with Pandas and Flower diff --git a/examples/quickstart_pytorch/README.md b/examples/quickstart_pytorch/README.md index b4633624614..66e36ca8d68 100644 --- a/examples/quickstart_pytorch/README.md +++ b/examples/quickstart_pytorch/README.md @@ -15,13 +15,15 @@ This will create a new directory called `quickstart_pytorch` containing the foll ```shell -- pyproject.toml +-- requirements.txt -- client.py -- server.py -- README.md ``` +### Installing Dependencies +Project dependencies (such as `torch` and `flwr`) are defined in `pyproject.toml` and 'requirements.txt'. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. -Project dependencies (such as `torch` and `flwr`) are defined in `pyproject.toml`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. - +#### Poetry ```shell poetry install poetry shell @@ -30,11 +32,18 @@ poetry shell Poetry will install all your dependencies in a newly created virtual environment. To verify that everything works correctly you can run the following command: ```shell -python3 -c "import flwr" +poetry run python3 -c "import flwr" ``` If you don't see any errors you're good to go! +#### Pip +Write the command below in your terminal to install the dependencies according to the configuration file requirements.txt. +```shell +pip install -r requirements.txt +``` + + # Run Federated Learning with PyTorch and Flower Afterwards you are ready to start the Flower server as well as the clients. You can simply start the server in a terminal as follows: diff --git a/examples/quickstart_tabnet/README.md b/examples/quickstart_tabnet/README.md index 6e2771a0d79..efbd1d1705f 100644 --- a/examples/quickstart_tabnet/README.md +++ b/examples/quickstart_tabnet/README.md @@ -14,13 +14,16 @@ This will create a new directory called `quickstart_tabnet` containing the follo ```shell -- pyproject.toml +-- requirements.txt -- client.py -- server.py -- README.md ``` -Project dependencies (such as `tensorflow` and `flwr`) are defined in `pyproject.toml`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +### Installing Dependencies +Project dependencies (such as `tensorflow` and `flwr`) are defined in `pyproject.toml` and 'requirements.txt'. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +#### Poetry ```shell poetry install poetry shell @@ -29,11 +32,17 @@ poetry shell Poetry will install all your dependencies in a newly created virtual environment. To verify that everything works correctly you can run the following command: ```shell -poetry run python -c "import flwr" +poetry run python3 -c "import flwr" ``` If you don't see any errors you're good to go! +#### Pip +Write the command below in your terminal to install the dependencies according to the configuration file requirements.txt. +```shell +pip install -r requirements.txt +``` + ## Run Federated Learning with TensorFlow/Keras and Flower Afterwards you are ready to start the Flower server as well as the clients. You can simply start the server in a terminal as follows: diff --git a/examples/quickstart_tensorflow/README.md b/examples/quickstart_tensorflow/README.md index dd780c35073..8ac458f6dac 100644 --- a/examples/quickstart_tensorflow/README.md +++ b/examples/quickstart_tensorflow/README.md @@ -15,13 +15,16 @@ This will create a new directory called `quickstart_tensorflow` containing the f ```shell -- pyproject.toml +-- requirements.txt -- client.py -- server.py -- README.md ``` -Project dependencies (such as `tensorflow` and `flwr`) are defined in `pyproject.toml`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +### Installing Dependencies +Project dependencies (such as `tensorflow` and `flwr`) are defined in `pyproject.toml` and 'requirements.txt'. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +#### Poetry ```shell poetry install poetry shell @@ -35,6 +38,12 @@ poetry run python3 -c "import flwr" If you don't see any errors you're good to go! +#### Pip +Write the command below in your terminal to install the dependencies according to the configuration file requirements.txt. +```shell +pip install -r requirements.txt +``` + ## Run Federated Learning with TensorFlow/Keras and Flower Afterwards you are ready to start the Flower server as well as the clients. You can simply start the server in a terminal as follows: diff --git a/examples/sklearn-logreg-mnist/README.md b/examples/sklearn-logreg-mnist/README.md index 6883a6760f0..0aabb07e912 100644 --- a/examples/sklearn-logreg-mnist/README.md +++ b/examples/sklearn-logreg-mnist/README.md @@ -15,14 +15,16 @@ This will create a new directory called `sklearn-logreg-mnist` containing the fo ```shell -- pyproject.toml +-- requirements.txt -- client.py -- server.py -- utils.py -- README.md ``` +### Installing Dependencies +Project dependencies (such as `scikit-learn` and `flwr`) are defined in `pyproject.toml` and 'requirements.txt'. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. -Project dependencies (such as `scikit-learn` and `flwr`) are defined in `pyproject.toml`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. - +#### Poetry ```shell poetry install poetry shell @@ -36,6 +38,12 @@ poetry run python3 -c "import flwr" If you don't see any errors you're good to go! +#### Pip +Write the command below in your terminal to install the dependencies according to the configuration file requirements.txt. +```shell +pip install -r requirements.txt +``` + # Run Federated Learning with scikit-learn and Flower Afterwards you are ready to start the Flower server as well as the clients. You can simply start the server in a terminal as follows: From 2cdb1c9cc6771d89ae2fce7c3de6692a868ad259 Mon Sep 17 00:00:00 2001 From: danielnugraha Date: Wed, 17 May 2023 12:58:07 +0200 Subject: [PATCH 11/27] update syntax to requirements.txt in readme --- examples/advanced_pytorch/README.md | 2 +- examples/advanced_tensorflow/README.md | 3 ++- examples/android/README.md | 2 +- examples/dp-sgd-mnist/README.md | 2 +- examples/ios/README.md | 14 +++++++++++--- .../README.md | 2 +- .../README.md | 2 +- .../README.md | 2 +- examples/quickstart_fastai/README.md | 2 +- examples/quickstart_huggingface/README.md | 2 +- examples/quickstart_jax/README.md | 2 +- examples/quickstart_mxnet/README.md | 2 +- examples/quickstart_pandas/README.md | 2 +- examples/quickstart_pytorch/README.md | 2 +- examples/quickstart_tabnet/README.md | 2 +- examples/quickstart_tensorflow/README.md | 2 +- examples/simulation_tensorflow/README.md | 19 +++++++++++++++---- examples/sklearn-logreg-mnist/README.md | 2 +- 18 files changed, 43 insertions(+), 23 deletions(-) diff --git a/examples/advanced_pytorch/README.md b/examples/advanced_pytorch/README.md index e278957509b..0b226b39273 100644 --- a/examples/advanced_pytorch/README.md +++ b/examples/advanced_pytorch/README.md @@ -29,7 +29,7 @@ This will create a new directory called `advanced_pytorch` containing the follow ``` ### Installing Dependencies -Project dependencies (such as `torch` and `flwr`) are defined in `pyproject.toml` and 'requirements.txt'. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +Project dependencies (such as `torch` and `flwr`) are defined in `pyproject.toml` and `requirements.txt`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. #### Poetry ```shell diff --git a/examples/advanced_tensorflow/README.md b/examples/advanced_tensorflow/README.md index a031a66ffaf..df561fae9c9 100644 --- a/examples/advanced_tensorflow/README.md +++ b/examples/advanced_tensorflow/README.md @@ -21,6 +21,7 @@ This will create a new directory called `advanced_tensorflow` containing the fol ```shell -- pyproject.toml +-- requirements.txt -- client.py -- server.py -- README.md @@ -28,7 +29,7 @@ This will create a new directory called `advanced_tensorflow` containing the fol ``` ### Installing Dependencies -Project dependencies (such as `tensorflow` and `flwr`) are defined in `pyproject.toml` and 'requirements.txt'. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +Project dependencies (such as `tensorflow` and `flwr`) are defined in `pyproject.toml` and `requirements.txt`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. #### Poetry ```shell diff --git a/examples/android/README.md b/examples/android/README.md index 581c51e366d..394f96ea553 100644 --- a/examples/android/README.md +++ b/examples/android/README.md @@ -17,7 +17,7 @@ git clone --depth=1 https://github.com/adap/flower.git && mv flower/examples/and ``` ### Installing Dependencies -Project dependencies (such as `tensorflow` and `flwr`) are defined in `pyproject.toml` and 'requirements.txt'. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +Project dependencies (such as `tensorflow` and `flwr`) are defined in `pyproject.toml` and `requirements.txt`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. #### Poetry ```shell diff --git a/examples/dp-sgd-mnist/README.md b/examples/dp-sgd-mnist/README.md index 9c2468d3ec6..412347ca661 100644 --- a/examples/dp-sgd-mnist/README.md +++ b/examples/dp-sgd-mnist/README.md @@ -25,7 +25,7 @@ This will create a new directory called `dp-sgd-mnist` containing the following -- README.md ``` ### Installing Dependencies -Project dependencies (such as `tensorflow` and `tensorflow-privacy`) are defined in `pyproject.toml` and 'requirements.txt'. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +Project dependencies (such as `tensorflow` and `tensorflow-privacy`) are defined in `pyproject.toml` and `requirements.txt`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. #### Poetry ```shell diff --git a/examples/ios/README.md b/examples/ios/README.md index 2b22d8bbca3..343f178164c 100644 --- a/examples/ios/README.md +++ b/examples/ios/README.md @@ -4,8 +4,10 @@ FLiOS is a sample application for testing and benchmarking the Swift implementat ## Project Setup -Project dependencies (`flwr`) are defined in `pyproject.toml`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +### Installing Dependencies +Project dependencies (`flwr`) are defined in `pyproject.toml` and `requirements.txt`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +#### Poetry ```shell poetry install poetry shell @@ -14,11 +16,17 @@ poetry shell Poetry will install all your dependencies in a newly created virtual environment. To verify that everything works correctly you can run the following command: ```shell -python3 -c "import flwr" +poetry run python3 -c "import flwr" ``` If you don't see any errors you're good to go! +#### Pip +Write the command below in your terminal to install the dependencies according to the configuration file requirements.txt. +```shell +pip install -r requirements.txt +``` + # Run Federated Learning on iOS Clients To start the server, write the following command in the terminal in the ios folder (with the conda environment created above): @@ -27,7 +35,7 @@ To start the server, write the following command in the terminal in the ios fold python3 server.py ``` -Open the FlowerCoreML.xcodeproj with XCode, wait until the dependencies are fetched, then click build and run with iPhone 13 Pro Max as target, or you can deploy it in your own iOS device by connecting your Mac, where you run your XCode, and your iPhone. +Open the FLiOS.xcodeproj with XCode, wait until the dependencies are fetched, then click build and run with iPhone 13 Pro Max as target, or you can deploy it in your own iOS device by connecting your Mac, where you run your XCode, and your iPhone. When the iOS app runs, load both the training and test dataset first. Then enter the hostname and port of your server in the TextField provided. Finally press `Start` which will start the federated training. diff --git a/examples/mxnet_from_centralized_to_federated/README.md b/examples/mxnet_from_centralized_to_federated/README.md index fcf65a2044e..e33aba53837 100644 --- a/examples/mxnet_from_centralized_to_federated/README.md +++ b/examples/mxnet_from_centralized_to_federated/README.md @@ -24,7 +24,7 @@ This will create a new directory called `mxnet_from_centralized_to_federated` co ``` ### Installing Dependencies -Project dependencies (such as `mxnet` and `flwr`) are defined in `pyproject.toml` and 'requirements.txt'. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +Project dependencies (such as `mxnet` and `flwr`) are defined in `pyproject.toml` and `requirements.txt`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. #### Poetry ```shell diff --git a/examples/pytorch_federated_variational_autoencoder/README.md b/examples/pytorch_federated_variational_autoencoder/README.md index 180603bd408..ba01e92196b 100644 --- a/examples/pytorch_federated_variational_autoencoder/README.md +++ b/examples/pytorch_federated_variational_autoencoder/README.md @@ -21,7 +21,7 @@ This will create a new directory called `pytorch_federated_variational_autoencod ``` ### Installing Dependencies -Project dependencies (such as `torch` and `flwr`) are defined in `pyproject.toml` and 'requirements.txt'. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +Project dependencies (such as `torch` and `flwr`) are defined in `pyproject.toml` and `requirements.txt`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. #### Poetry ```shell diff --git a/examples/pytorch_from_centralized_to_federated/README.md b/examples/pytorch_from_centralized_to_federated/README.md index 2a1a2c02816..c7538264214 100644 --- a/examples/pytorch_from_centralized_to_federated/README.md +++ b/examples/pytorch_from_centralized_to_federated/README.md @@ -24,7 +24,7 @@ This will create a new directory called `pytorch_from_centralized_to_federated` ``` ### Installing Dependencies -Project dependencies (such as `torch` and `flwr`) are defined in `pyproject.toml` and 'requirements.txt'. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +Project dependencies (such as `torch` and `flwr`) are defined in `pyproject.toml` and `requirements.txt`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. #### Poetry ```shell diff --git a/examples/quickstart_fastai/README.md b/examples/quickstart_fastai/README.md index 2c931a8f30b..848315816f7 100644 --- a/examples/quickstart_fastai/README.md +++ b/examples/quickstart_fastai/README.md @@ -23,7 +23,7 @@ This will create a new directory called `quickstart_fastai` containing the follo ``` ### Installing Dependencies -Project dependencies (such as `fastai` and `flwr`) are defined in `pyproject.toml` and 'requirements.txt'. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +Project dependencies (such as `fastai` and `flwr`) are defined in `pyproject.toml` and `requirements.txt`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. #### Poetry ```shell diff --git a/examples/quickstart_huggingface/README.md b/examples/quickstart_huggingface/README.md index fb0b4ad106d..3f3e09e9a89 100644 --- a/examples/quickstart_huggingface/README.md +++ b/examples/quickstart_huggingface/README.md @@ -23,7 +23,7 @@ This will create a new directory called `quickstart_huggingface` containing the ``` ### Installing Dependencies -Project dependencies (such as `torch` and `flwr`) are defined in `pyproject.toml` and 'requirements.txt'. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +Project dependencies (such as `torch` and `flwr`) are defined in `pyproject.toml` and `requirements.txt`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. #### Poetry ```shell diff --git a/examples/quickstart_jax/README.md b/examples/quickstart_jax/README.md index febb2bb4676..b64b16b126b 100644 --- a/examples/quickstart_jax/README.md +++ b/examples/quickstart_jax/README.md @@ -24,7 +24,7 @@ This will create a new directory called `quickstart_jax`, containing the followi ``` ### Installing Dependencies -Project dependencies (such as `jax` and `flwr`) are defined in `pyproject.toml` and 'requirements.txt'. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +Project dependencies (such as `jax` and `flwr`) are defined in `pyproject.toml` and `requirements.txt`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. #### Poetry ```shell diff --git a/examples/quickstart_mxnet/README.md b/examples/quickstart_mxnet/README.md index 226b96485b9..b97fcb3f48f 100644 --- a/examples/quickstart_mxnet/README.md +++ b/examples/quickstart_mxnet/README.md @@ -23,7 +23,7 @@ This will create a new directory called `quickstart_mxnet` containing the follow ``` ### Installing Dependencies -Project dependencies (such as `mxnet` and `flwr`) are defined in `pyproject.toml` and 'requirements.txt'. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +Project dependencies (such as `mxnet` and `flwr`) are defined in `pyproject.toml` and `requirements.txt`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. #### Poetry ```shell diff --git a/examples/quickstart_pandas/README.md b/examples/quickstart_pandas/README.md index e7023322b10..c294168bceb 100644 --- a/examples/quickstart_pandas/README.md +++ b/examples/quickstart_pandas/README.md @@ -30,7 +30,7 @@ $ python -c "from sklearn.datasets import load_iris; load_iris(as_frame=True)['d ``` ### Installing Dependencies -Project dependencies (such as `pandas` and `flwr`) are defined in `pyproject.toml` and 'requirements.txt'. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +Project dependencies (such as `pandas` and `flwr`) are defined in `pyproject.toml` and `requirements.txt`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. #### Poetry ```shell diff --git a/examples/quickstart_pytorch/README.md b/examples/quickstart_pytorch/README.md index 66e36ca8d68..db2417e572b 100644 --- a/examples/quickstart_pytorch/README.md +++ b/examples/quickstart_pytorch/README.md @@ -21,7 +21,7 @@ This will create a new directory called `quickstart_pytorch` containing the foll -- README.md ``` ### Installing Dependencies -Project dependencies (such as `torch` and `flwr`) are defined in `pyproject.toml` and 'requirements.txt'. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +Project dependencies (such as `torch` and `flwr`) are defined in `pyproject.toml` and `requirements.txt`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. #### Poetry ```shell diff --git a/examples/quickstart_tabnet/README.md b/examples/quickstart_tabnet/README.md index efbd1d1705f..46f88319399 100644 --- a/examples/quickstart_tabnet/README.md +++ b/examples/quickstart_tabnet/README.md @@ -21,7 +21,7 @@ This will create a new directory called `quickstart_tabnet` containing the follo ``` ### Installing Dependencies -Project dependencies (such as `tensorflow` and `flwr`) are defined in `pyproject.toml` and 'requirements.txt'. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +Project dependencies (such as `tensorflow` and `flwr`) are defined in `pyproject.toml` and `requirements.txt`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. #### Poetry ```shell diff --git a/examples/quickstart_tensorflow/README.md b/examples/quickstart_tensorflow/README.md index 8ac458f6dac..0667f17ab6e 100644 --- a/examples/quickstart_tensorflow/README.md +++ b/examples/quickstart_tensorflow/README.md @@ -22,7 +22,7 @@ This will create a new directory called `quickstart_tensorflow` containing the f ``` ### Installing Dependencies -Project dependencies (such as `tensorflow` and `flwr`) are defined in `pyproject.toml` and 'requirements.txt'. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +Project dependencies (such as `tensorflow` and `flwr`) are defined in `pyproject.toml` and `requirements.txt`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. #### Poetry ```shell diff --git a/examples/simulation_tensorflow/README.md b/examples/simulation_tensorflow/README.md index 170062fc4eb..ef84af0d42b 100644 --- a/examples/simulation_tensorflow/README.md +++ b/examples/simulation_tensorflow/README.md @@ -8,7 +8,7 @@ Run the example on Google Colab: [![Open in Colab](https://colab.research.google Alternatively, you can run `sim.ipynb` locally or in any other Jupyter environment. -## Running the example (via Poetry) +## Running the example Start by cloning the code example. We prepared a single-line command that you can copy into your shell which will checkout the example for you: @@ -22,13 +22,17 @@ This will create a new directory called `quickstart_simulation` containing the f -- README.md <- Your're reading this right now -- sim.ipynb <- Example notebook -- sim.py <- Example code --- pyproject.toml <- Example dependencies (for Poetry) +-- pyproject.toml <- Example dependencies +-- requirements.txt <- Example dependencies ``` -Project dependencies (such as `tensorflow` and `flwr`) are defined in `pyproject.toml` (the modern alternative to `requirements.txt`). We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +### Installing Dependencies +Project dependencies (such as `torch` and `flwr`) are defined in `pyproject.toml` and `requirements.txt`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +#### Poetry ```shell poetry install +poetry shell ``` Poetry will install all your dependencies in a newly created virtual environment. To verify that everything works correctly you can run the following command: @@ -37,8 +41,15 @@ Poetry will install all your dependencies in a newly created virtual environment poetry run python3 -c "import flwr" ``` -If you don't see any errors you're good to go! +If you don't see any errors you're good to go! +#### Pip +Write the command below in your terminal to install the dependencies according to the configuration file requirements.txt. +```shell +pip install -r requirements.txt +``` + +### Run Federated Learning Example ```bash poetry run python3 sim.py ``` diff --git a/examples/sklearn-logreg-mnist/README.md b/examples/sklearn-logreg-mnist/README.md index 0aabb07e912..26715753550 100644 --- a/examples/sklearn-logreg-mnist/README.md +++ b/examples/sklearn-logreg-mnist/README.md @@ -22,7 +22,7 @@ This will create a new directory called `sklearn-logreg-mnist` containing the fo -- README.md ``` ### Installing Dependencies -Project dependencies (such as `scikit-learn` and `flwr`) are defined in `pyproject.toml` and 'requirements.txt'. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. +Project dependencies (such as `scikit-learn` and `flwr`) are defined in `pyproject.toml` and `requirements.txt`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. #### Poetry ```shell From ece723526a3e1ce40a89baf9e6dc17be6abf2511 Mon Sep 17 00:00:00 2001 From: danielnugraha Date: Wed, 17 May 2023 17:28:37 +0200 Subject: [PATCH 12/27] apply consistent styling --- examples/advanced_pytorch/README.md | 8 +++++--- examples/advanced_tensorflow/README.md | 6 +++++- examples/android/README.md | 6 +++++- examples/dp-sgd-mnist/README.md | 8 ++++++-- examples/embedded_devices/README.md | 8 ++++++++ examples/ios/README.md | 6 +++++- examples/mxnet_from_centralized_to_federated/README.md | 4 ++++ examples/opacus/README.md | 1 - .../pytorch_federated_variational_autoencoder/README.md | 6 +++++- examples/pytorch_from_centralized_to_federated/README.md | 6 +++++- examples/quickstart_cpp/README.md | 5 ++++- examples/quickstart_fastai/README.md | 6 +++++- examples/quickstart_huggingface/README.md | 6 +++++- examples/quickstart_jax/README.md | 6 +++++- examples/quickstart_mxnet/README.md | 6 +++++- examples/quickstart_pandas/README.md | 6 +++++- examples/quickstart_pytorch/README.md | 7 +++++-- examples/quickstart_tabnet/README.md | 8 ++++++-- examples/quickstart_tensorflow/README.md | 6 +++++- examples/simulation_pytorch/README.md | 1 + examples/simulation_tensorflow/README.md | 7 ++++++- examples/sklearn-logreg-mnist/README.md | 7 ++++++- 22 files changed, 106 insertions(+), 24 deletions(-) diff --git a/examples/advanced_pytorch/README.md b/examples/advanced_pytorch/README.md index 0b226b39273..b4e61372600 100644 --- a/examples/advanced_pytorch/README.md +++ b/examples/advanced_pytorch/README.md @@ -29,9 +29,11 @@ This will create a new directory called `advanced_pytorch` containing the follow ``` ### Installing Dependencies + Project dependencies (such as `torch` and `flwr`) are defined in `pyproject.toml` and `requirements.txt`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. #### Poetry + ```shell poetry install poetry shell @@ -45,13 +47,14 @@ poetry run python3 -c "import flwr" If you don't see any errors you're good to go! -#### Pip +#### pip + Write the command below in your terminal to install the dependencies according to the configuration file requirements.txt. + ```shell pip install -r requirements.txt ``` - # Run Federated Learning with PyTorch and Flower The included `run.sh` will start the Flower server (using `server.py`), @@ -65,4 +68,3 @@ poetry run ./run.sh The `run.sh` script starts processes in the background so that you don't have to open eleven terminal windows. If you experiment with the code example and something goes wrong, simply using `CTRL + C` on Linux (or `CMD + C` on macOS) wouldn't normally kill all these processes, which is why the script ends with `trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT` and `wait`. This simply allows you to stop the experiment using `CTRL + C` (or `CMD + C`). If you change the script and anything goes wrong you can still use `killall python` (or `killall python3`) to kill all background processes (or a more specific command if you have other Python processes running that you don't want to kill). You can also manually run `poetry run python3 server.py` and `poetry run python3 client.py` for as many clients as you want but you have to make sure that each command is ran in a different terminal window (or a different computer on the network). - diff --git a/examples/advanced_tensorflow/README.md b/examples/advanced_tensorflow/README.md index df561fae9c9..152ca39dea7 100644 --- a/examples/advanced_tensorflow/README.md +++ b/examples/advanced_tensorflow/README.md @@ -29,9 +29,11 @@ This will create a new directory called `advanced_tensorflow` containing the fol ``` ### Installing Dependencies + Project dependencies (such as `tensorflow` and `flwr`) are defined in `pyproject.toml` and `requirements.txt`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. #### Poetry + ```shell poetry install poetry shell @@ -45,8 +47,10 @@ poetry run python3 -c "import flwr" If you don't see any errors you're good to go! -#### Pip +#### pip + Write the command below in your terminal to install the dependencies according to the configuration file requirements.txt. + ```shell pip install -r requirements.txt ``` diff --git a/examples/android/README.md b/examples/android/README.md index 394f96ea553..9a8c54d43da 100644 --- a/examples/android/README.md +++ b/examples/android/README.md @@ -17,9 +17,11 @@ git clone --depth=1 https://github.com/adap/flower.git && mv flower/examples/and ``` ### Installing Dependencies + Project dependencies (such as `tensorflow` and `flwr`) are defined in `pyproject.toml` and `requirements.txt`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. #### Poetry + ```shell poetry install poetry shell @@ -33,8 +35,10 @@ poetry run python3 -c "import flwr" If you don't see any errors you're good to go! -#### Pip +#### pip + Write the command below in your terminal to install the dependencies according to the configuration file requirements.txt. + ```shell pip install -r requirements.txt ``` diff --git a/examples/dp-sgd-mnist/README.md b/examples/dp-sgd-mnist/README.md index 412347ca661..2f1209dc979 100644 --- a/examples/dp-sgd-mnist/README.md +++ b/examples/dp-sgd-mnist/README.md @@ -25,9 +25,11 @@ This will create a new directory called `dp-sgd-mnist` containing the following -- README.md ``` ### Installing Dependencies + Project dependencies (such as `tensorflow` and `tensorflow-privacy`) are defined in `pyproject.toml` and `requirements.txt`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. #### Poetry + ```shell poetry install poetry shell @@ -41,8 +43,10 @@ poetry run python3 -c "import flwr" If you don't see any errors you're good to go! -#### Pip +#### pip + Write the command below in your terminal to install the dependencies according to the configuration file requirements.txt. + ```shell pip install -r requirements.txt ``` @@ -55,6 +59,7 @@ Afterwards you are ready to start the Flower server as well as the clients. You # terminal 1 poetry run python3 server.py ``` + Now you are ready to start the Flower clients which will participate in the learning. To do so simply open two more terminals and run the following command in each: ```shell @@ -86,7 +91,6 @@ poetry run python3 client.py --num-clients 3 --partition 1 & poetry run python3 client.py --num-clients 3 --partition 2 --dpsgd True ``` - Additional training parameters for the client and server can be referenced by passing `--help` to either script. Other things to note is that when all clients are running `dpsgd`, either train for more rounds or increase the local epochs to achieve optimal performance. You shall need to carefully tune the hyperparameters to your specific setup. diff --git a/examples/embedded_devices/README.md b/examples/embedded_devices/README.md index 8010dcf4729..169f04edfb0 100644 --- a/examples/embedded_devices/README.md +++ b/examples/embedded_devices/README.md @@ -36,11 +36,13 @@ The only requirement for the server is to have flower installed. You can do so b 2. Extract the imgae (~14GB) and flash it onto the uSD card using Etcher (or equivalent). 3. Follow [the instructions](https://developer.nvidia.com/embedded/learn/get-started-jetson-xavier-nx-devkit) to setup the device. 4. Installing Docker: Docker comes pre-installed with the Ubuntu image provided by NVIDIA. But for convinience we will create a new user group and add our user to it (with the idea of not having to use `sudo` for every command involving docker (e.g. `docker run`, `docker ps`, etc)). More details about what this entails can be found in the [Docker documentation](https://docs.docker.com/engine/install/linux-postinstall/). You can achieve this by doing: + ``` bash $ sudo usermod -aG docker $USER # apply changes to current shell (or logout/reboot) $ newgrp docker ``` + 5. The minimal installation to run this example only requires an additional package, `git`, in order to clone this repo. Install `git` by: ```bash @@ -50,6 +52,7 @@ The only requirement for the server is to have flower installed. You can do so b 6. (optional) additional packages: * [jtop](https://github.com/rbonghi/jetson_stats), to monitor CPU/GPU utilization, power consumption and, many more. + ```bash # First we need to install pip3 $ sudo apt-get install python3-pip -y @@ -58,7 +61,9 @@ The only requirement for the server is to have flower installed. You can do so b # finally, install jtop $ sudo -H pip3 install -U jetson-stats ``` + * [TMUX](https://github.com/tmux/tmux/wiki), a terminal multiplexer. + ```bash # install tmux $ sudo apt-get install tmux -y @@ -67,6 +72,7 @@ The only requirement for the server is to have flower installed. You can do so b ``` 7. Power modes: The Jetson devices can operate at different power modes, each making use of more or less CPU cores clocked at different freqencies. The right power mode might very much depend on the application and scenario. When power consumption is not a limiting factor, we could use the highest 15W mode using all 6 CPU cores. On the other hand, if the devices are battery-powered we might want to make use of a low power mode using 10W and 2 CPU cores. All the details regarding the different power modes of a Jetson Xavier-NX can be found [here](https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%2520Linux%2520Driver%2520Package%2520Development%2520Guide%2Fpower_management_jetson_xavier.html%23wwpID0E0NO0HA). For this demo we'll be setting the device to the high performance mode: + ```bash $ sudo /usr/sbin/nvpmodel -m 2 # 15W with 6cpus @ 1.4GHz ``` @@ -76,6 +82,7 @@ The only requirement for the server is to have flower installed. You can do so b 1. Install Ubuntu server 20.04 LTS 64-bit for Rapsberry Pi. You can do this by using one of the images provided [by Ubuntu](https://ubuntu.com/download/raspberry-pi) and then use Etcher. Alternativelly, astep-by-step installation guide, showing how to download and flash the image onto a uSD card and, go throught the first boot process, can be found [here](https://ubuntu.com/tutorials/how-to-install-ubuntu-on-your-raspberry-pi#1-overview). Please note that the first time you boot your RPi it will automatically update the system (which will lock `sudo` and prevent running the commands below for a few minutes) 2. Install docker (+ post-installation steps as in [Docker Docs](https://docs.docker.com/engine/install/linux-postinstall/)): + ```bash # make sure your OS is up-to-date $ sudo apt-get update @@ -104,6 +111,7 @@ For this demo we'll be using [CIFAR-10](https://www.cs.toronto.edu/~kriz/cifar.h ## Server Launch the server and define the model you'd like to train. The current code (see `utils.py`) provides two models for CIFAR-10: a small CNN (more suitable for Raspberry Pi) and, a ResNet18, which will run well on the gpu. Each model can be specified using the `--model` flag with options `Net` or `ResNet18`. Launch a FL training setup with one client and doing three rounds as: + ```bash # launch your server. It will be waiting until one client connects $ python server.py --server_address --rounds 3 --min_num_clients 1 --min_sample_size 1 --model ResNet18 diff --git a/examples/ios/README.md b/examples/ios/README.md index 343f178164c..83908abd8ad 100644 --- a/examples/ios/README.md +++ b/examples/ios/README.md @@ -5,9 +5,11 @@ FLiOS is a sample application for testing and benchmarking the Swift implementat ## Project Setup ### Installing Dependencies + Project dependencies (`flwr`) are defined in `pyproject.toml` and `requirements.txt`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. #### Poetry + ```shell poetry install poetry shell @@ -21,8 +23,10 @@ poetry run python3 -c "import flwr" If you don't see any errors you're good to go! -#### Pip +#### pip + Write the command below in your terminal to install the dependencies according to the configuration file requirements.txt. + ```shell pip install -r requirements.txt ``` diff --git a/examples/mxnet_from_centralized_to_federated/README.md b/examples/mxnet_from_centralized_to_federated/README.md index e33aba53837..6d8b8002dc5 100644 --- a/examples/mxnet_from_centralized_to_federated/README.md +++ b/examples/mxnet_from_centralized_to_federated/README.md @@ -24,9 +24,11 @@ This will create a new directory called `mxnet_from_centralized_to_federated` co ``` ### Installing Dependencies + Project dependencies (such as `mxnet` and `flwr`) are defined in `pyproject.toml` and `requirements.txt`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. #### Poetry + ```shell poetry install poetry shell @@ -41,7 +43,9 @@ poetry run python3 -c "import flwr" If you don't see any errors you're good to go! #### Pip + Write the command below in your terminal to install the dependencies according to the configuration file requirements.txt. + ```shell pip install -r requirements.txt ``` diff --git a/examples/opacus/README.md b/examples/opacus/README.md index a57c0ea5f58..7554d893c82 100644 --- a/examples/opacus/README.md +++ b/examples/opacus/README.md @@ -26,4 +26,3 @@ Run the server with `python server.py`. Then open two (or more) new terminals to Note: It is not possible to see the total privacy budget used with this example since the simulation creates clients from scratch every round. Run the simulation with `python dp_cifar_simulation.py`. - diff --git a/examples/pytorch_federated_variational_autoencoder/README.md b/examples/pytorch_federated_variational_autoencoder/README.md index ba01e92196b..4ba0ac4f059 100644 --- a/examples/pytorch_federated_variational_autoencoder/README.md +++ b/examples/pytorch_federated_variational_autoencoder/README.md @@ -21,9 +21,11 @@ This will create a new directory called `pytorch_federated_variational_autoencod ``` ### Installing Dependencies + Project dependencies (such as `torch` and `flwr`) are defined in `pyproject.toml` and `requirements.txt`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. #### Poetry + ```shell poetry install poetry shell @@ -37,8 +39,10 @@ poetry run python3 -c "import flwr" If you don't see any errors you're good to go! -#### Pip +#### pip + Write the command below in your terminal to install the dependencies according to the configuration file requirements.txt. + ```shell pip install -r requirements.txt ``` diff --git a/examples/pytorch_from_centralized_to_federated/README.md b/examples/pytorch_from_centralized_to_federated/README.md index c7538264214..1d29286c9b0 100644 --- a/examples/pytorch_from_centralized_to_federated/README.md +++ b/examples/pytorch_from_centralized_to_federated/README.md @@ -24,9 +24,11 @@ This will create a new directory called `pytorch_from_centralized_to_federated` ``` ### Installing Dependencies + Project dependencies (such as `torch` and `flwr`) are defined in `pyproject.toml` and `requirements.txt`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. #### Poetry + ```shell poetry install poetry shell @@ -40,8 +42,10 @@ poetry run python3 -c "import flwr" If you don't see any errors you're good to go! -#### Pip +#### pip + Write the command below in your terminal to install the dependencies according to the configuration file requirements.txt. + ```shell pip install -r requirements.txt ``` diff --git a/examples/quickstart_cpp/README.md b/examples/quickstart_cpp/README.md index ad7b6e22824..4525b2ff20b 100644 --- a/examples/quickstart_cpp/README.md +++ b/examples/quickstart_cpp/README.md @@ -3,17 +3,19 @@ In this example you will train a linear model on synthetic data using C++ clients. # Acknowledgements + Many thanks to the original contributors to this code: - Lekang Jiang (original author and main contributor) - Francisco José Solís (code re-organization) - Andreea Zaharia (training algorithm and data generation) # Install requirements + You'll need CMake and Python. ### Building the example -This example provides you with a `CMakeLists.txt` file to configure and build the client. Feel free to take a look inside it to see what is happening under the hood. +This example provides you with a `CMakeLists.txt` file to configure and build the client. Feel free to take a look inside it to see what is happening under the hood. ```bash cmake -S . -B build @@ -21,6 +23,7 @@ cmake --build build ``` # Run the server and two clients in separate terminals + ```bash python server.py ``` diff --git a/examples/quickstart_fastai/README.md b/examples/quickstart_fastai/README.md index 848315816f7..d2d65117131 100644 --- a/examples/quickstart_fastai/README.md +++ b/examples/quickstart_fastai/README.md @@ -23,9 +23,11 @@ This will create a new directory called `quickstart_fastai` containing the follo ``` ### Installing Dependencies + Project dependencies (such as `fastai` and `flwr`) are defined in `pyproject.toml` and `requirements.txt`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. #### Poetry + ```shell poetry install poetry shell @@ -39,8 +41,10 @@ poetry run python3 -c "import flwr" If you don't see any errors you're good to go! -#### Pip +#### pip + Write the command below in your terminal to install the dependencies according to the configuration file requirements.txt. + ```shell pip install -r requirements.txt ``` diff --git a/examples/quickstart_huggingface/README.md b/examples/quickstart_huggingface/README.md index 3f3e09e9a89..d999c2eb746 100644 --- a/examples/quickstart_huggingface/README.md +++ b/examples/quickstart_huggingface/README.md @@ -23,9 +23,11 @@ This will create a new directory called `quickstart_huggingface` containing the ``` ### Installing Dependencies + Project dependencies (such as `torch` and `flwr`) are defined in `pyproject.toml` and `requirements.txt`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. #### Poetry + ```shell poetry install poetry shell @@ -39,8 +41,10 @@ poetry run python3 -c "import flwr" If you don't see any errors you're good to go! -#### Pip +#### pip + Write the command below in your terminal to install the dependencies according to the configuration file requirements.txt. + ```shell pip install -r requirements.txt ``` diff --git a/examples/quickstart_jax/README.md b/examples/quickstart_jax/README.md index b64b16b126b..3b7c8008714 100644 --- a/examples/quickstart_jax/README.md +++ b/examples/quickstart_jax/README.md @@ -24,9 +24,11 @@ This will create a new directory called `quickstart_jax`, containing the followi ``` ### Installing Dependencies + Project dependencies (such as `jax` and `flwr`) are defined in `pyproject.toml` and `requirements.txt`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. #### Poetry + ```shell poetry install poetry shell @@ -40,8 +42,10 @@ poetry run python3 -c "import flwr" If you don't see any errors you're good to go! -#### Pip +#### pip + Write the command below in your terminal to install the dependencies according to the configuration file requirements.txt. + ```shell pip install -r requirements.txt ``` diff --git a/examples/quickstart_mxnet/README.md b/examples/quickstart_mxnet/README.md index b97fcb3f48f..605b2f9aef6 100644 --- a/examples/quickstart_mxnet/README.md +++ b/examples/quickstart_mxnet/README.md @@ -23,9 +23,11 @@ This will create a new directory called `quickstart_mxnet` containing the follow ``` ### Installing Dependencies + Project dependencies (such as `mxnet` and `flwr`) are defined in `pyproject.toml` and `requirements.txt`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. #### Poetry + ```shell poetry install poetry shell @@ -39,8 +41,10 @@ poetry run python3 -c "import flwr" If you don't see any errors you're good to go! -#### Pip +#### pip + Write the command below in your terminal to install the dependencies according to the configuration file requirements.txt. + ```shell pip install -r requirements.txt ``` diff --git a/examples/quickstart_pandas/README.md b/examples/quickstart_pandas/README.md index c294168bceb..c6586848222 100644 --- a/examples/quickstart_pandas/README.md +++ b/examples/quickstart_pandas/README.md @@ -30,9 +30,11 @@ $ python -c "from sklearn.datasets import load_iris; load_iris(as_frame=True)['d ``` ### Installing Dependencies + Project dependencies (such as `pandas` and `flwr`) are defined in `pyproject.toml` and `requirements.txt`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. #### Poetry + ```shell poetry install poetry shell @@ -46,8 +48,10 @@ poetry run python3 -c "import flwr" If you don't see any errors you're good to go! -#### Pip +#### pip + Write the command below in your terminal to install the dependencies according to the configuration file requirements.txt. + ```shell pip install -r requirements.txt ``` diff --git a/examples/quickstart_pytorch/README.md b/examples/quickstart_pytorch/README.md index db2417e572b..0b8aa3c639b 100644 --- a/examples/quickstart_pytorch/README.md +++ b/examples/quickstart_pytorch/README.md @@ -21,9 +21,11 @@ This will create a new directory called `quickstart_pytorch` containing the foll -- README.md ``` ### Installing Dependencies + Project dependencies (such as `torch` and `flwr`) are defined in `pyproject.toml` and `requirements.txt`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. #### Poetry + ```shell poetry install poetry shell @@ -37,13 +39,14 @@ poetry run python3 -c "import flwr" If you don't see any errors you're good to go! -#### Pip +#### pip + Write the command below in your terminal to install the dependencies according to the configuration file requirements.txt. + ```shell pip install -r requirements.txt ``` - # Run Federated Learning with PyTorch and Flower Afterwards you are ready to start the Flower server as well as the clients. You can simply start the server in a terminal as follows: diff --git a/examples/quickstart_tabnet/README.md b/examples/quickstart_tabnet/README.md index 46f88319399..06a4883e4d8 100644 --- a/examples/quickstart_tabnet/README.md +++ b/examples/quickstart_tabnet/README.md @@ -21,9 +21,11 @@ This will create a new directory called `quickstart_tabnet` containing the follo ``` ### Installing Dependencies + Project dependencies (such as `tensorflow` and `flwr`) are defined in `pyproject.toml` and `requirements.txt`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. #### Poetry + ```shell poetry install poetry shell @@ -37,8 +39,10 @@ poetry run python3 -c "import flwr" If you don't see any errors you're good to go! -#### Pip +#### pip + Write the command below in your terminal to install the dependencies according to the configuration file requirements.txt. + ```shell pip install -r requirements.txt ``` @@ -63,4 +67,4 @@ Alternatively you can run all of it in one shell as follows: poetry run python server.py & poetry run python client.py & poetry run python client.py -``` \ No newline at end of file +``` diff --git a/examples/quickstart_tensorflow/README.md b/examples/quickstart_tensorflow/README.md index 0667f17ab6e..d78a1ac7969 100644 --- a/examples/quickstart_tensorflow/README.md +++ b/examples/quickstart_tensorflow/README.md @@ -22,9 +22,11 @@ This will create a new directory called `quickstart_tensorflow` containing the f ``` ### Installing Dependencies + Project dependencies (such as `tensorflow` and `flwr`) are defined in `pyproject.toml` and `requirements.txt`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. #### Poetry + ```shell poetry install poetry shell @@ -38,8 +40,10 @@ poetry run python3 -c "import flwr" If you don't see any errors you're good to go! -#### Pip +#### pip + Write the command below in your terminal to install the dependencies according to the configuration file requirements.txt. + ```shell pip install -r requirements.txt ``` diff --git a/examples/simulation_pytorch/README.md b/examples/simulation_pytorch/README.md index 56241bb6f98..657d28c342d 100644 --- a/examples/simulation_pytorch/README.md +++ b/examples/simulation_pytorch/README.md @@ -9,6 +9,7 @@ This code splits CIFAR-10 dataset into `pool_size` partitions (user defined) and * A recent version of Ray. This example has been tested with Ray 1.4.1, 1.6 and 1.9.2. From a clean virtualenv or Conda environment with Python 3.7+, the following command will isntall all the dependencies needed: + ```bash $ pip install -r requirements.txt ``` diff --git a/examples/simulation_tensorflow/README.md b/examples/simulation_tensorflow/README.md index ef84af0d42b..86ab8aa9543 100644 --- a/examples/simulation_tensorflow/README.md +++ b/examples/simulation_tensorflow/README.md @@ -27,9 +27,11 @@ This will create a new directory called `quickstart_simulation` containing the f ``` ### Installing Dependencies + Project dependencies (such as `torch` and `flwr`) are defined in `pyproject.toml` and `requirements.txt`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. #### Poetry + ```shell poetry install poetry shell @@ -43,13 +45,16 @@ poetry run python3 -c "import flwr" If you don't see any errors you're good to go! -#### Pip +#### pip + Write the command below in your terminal to install the dependencies according to the configuration file requirements.txt. + ```shell pip install -r requirements.txt ``` ### Run Federated Learning Example + ```bash poetry run python3 sim.py ``` diff --git a/examples/sklearn-logreg-mnist/README.md b/examples/sklearn-logreg-mnist/README.md index 26715753550..555d101e6fc 100644 --- a/examples/sklearn-logreg-mnist/README.md +++ b/examples/sklearn-logreg-mnist/README.md @@ -21,10 +21,13 @@ This will create a new directory called `sklearn-logreg-mnist` containing the fo -- utils.py -- README.md ``` + ### Installing Dependencies + Project dependencies (such as `scikit-learn` and `flwr`) are defined in `pyproject.toml` and `requirements.txt`. We recommend [Poetry](https://python-poetry.org/docs/) to install those dependencies and manage your virtual environment ([Poetry installation](https://python-poetry.org/docs/#installation)) or [pip](https://pip.pypa.io/en/latest/development/), but feel free to use a different way of installing dependencies and managing virtual environments if you have other preferences. #### Poetry + ```shell poetry install poetry shell @@ -38,8 +41,10 @@ poetry run python3 -c "import flwr" If you don't see any errors you're good to go! -#### Pip +#### pip + Write the command below in your terminal to install the dependencies according to the configuration file requirements.txt. + ```shell pip install -r requirements.txt ``` From 96d17eda270735e66d7c5b3892cad5dc4dba210d Mon Sep 17 00:00:00 2001 From: danielnugraha Date: Wed, 17 May 2023 18:40:21 +0200 Subject: [PATCH 13/27] add missing styling --- examples/mxnet_from_centralized_to_federated/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/mxnet_from_centralized_to_federated/README.md b/examples/mxnet_from_centralized_to_federated/README.md index 6d8b8002dc5..a0e29851a86 100644 --- a/examples/mxnet_from_centralized_to_federated/README.md +++ b/examples/mxnet_from_centralized_to_federated/README.md @@ -42,7 +42,7 @@ poetry run python3 -c "import flwr" If you don't see any errors you're good to go! -#### Pip +#### pip Write the command below in your terminal to install the dependencies according to the configuration file requirements.txt. From ee1c0c67c7ff993c019c1499d9fb43a1f05f6655 Mon Sep 17 00:00:00 2001 From: Taner Topal Date: Tue, 23 May 2023 13:27:27 +0200 Subject: [PATCH 14/27] Update dev/check-requirements-txt.sh --- dev/check-requirements-txt.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dev/check-requirements-txt.sh b/dev/check-requirements-txt.sh index a9c22ebc860..9165e454e19 100755 --- a/dev/check-requirements-txt.sh +++ b/dev/check-requirements-txt.sh @@ -15,11 +15,12 @@ # limitations under the License. # ============================================================================== -./generate-requirements-txt.sh - set -e cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/../ +# Regenerate requirements.txt files in case they changed +./generate-requirements-txt.sh + # Fail if user forgot to sync requirements.txt and pyproject.toml CHANGED=$(git diff --name-only HEAD examples) From 3230f666e5672c0da35a784b712826cc238990fe Mon Sep 17 00:00:00 2001 From: danielnugraha Date: Tue, 23 May 2023 17:34:11 +0200 Subject: [PATCH 15/27] update path to generate requirements script --- dev/check-requirements-txt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/check-requirements-txt.sh b/dev/check-requirements-txt.sh index 9165e454e19..64aa20ce44c 100755 --- a/dev/check-requirements-txt.sh +++ b/dev/check-requirements-txt.sh @@ -19,7 +19,7 @@ set -e cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/../ # Regenerate requirements.txt files in case they changed -./generate-requirements-txt.sh +./dev/generate-requirements-txt.sh # Fail if user forgot to sync requirements.txt and pyproject.toml CHANGED=$(git diff --name-only HEAD examples) From b99f107e24a934f159f9d9594a0497b06ef85bc7 Mon Sep 17 00:00:00 2001 From: danielnugraha Date: Tue, 23 May 2023 17:56:31 +0200 Subject: [PATCH 16/27] regenerate requirements.txt --- examples/android/requirements.txt | 2 +- examples/dp-sgd-mnist/requirements.txt | 2 +- examples/ios/requirements.txt | 2 +- examples/mxnet_from_centralized_to_federated/requirements.txt | 2 +- examples/opacus/requirements.txt | 2 +- .../pytorch_from_centralized_to_federated/requirements.txt | 2 +- examples/quickstart_huggingface/requirements.txt | 4 ++-- examples/quickstart_jax/requirements.txt | 2 +- examples/quickstart_mxnet/requirements.txt | 2 +- examples/quickstart_pandas/requirements.txt | 2 +- examples/simulation_pytorch/requirements.txt | 4 ++-- examples/sklearn-logreg-mnist/requirements.txt | 2 +- 12 files changed, 14 insertions(+), 14 deletions(-) diff --git a/examples/android/requirements.txt b/examples/android/requirements.txt index e75049b33f0..b4506379718 100644 --- a/examples/android/requirements.txt +++ b/examples/android/requirements.txt @@ -1 +1 @@ -numpy~=1.21.1 +numpy~=1.24.3 diff --git a/examples/dp-sgd-mnist/requirements.txt b/examples/dp-sgd-mnist/requirements.txt index fa51400e9e0..d8ad03be876 100644 --- a/examples/dp-sgd-mnist/requirements.txt +++ b/examples/dp-sgd-mnist/requirements.txt @@ -1,4 +1,4 @@ flwr~=1.4.0 -numpy~=1.21.1 +numpy~=1.24.3 tensorflow~=2.12.0 tensorflow_privacy~=0.8.9 diff --git a/examples/ios/requirements.txt b/examples/ios/requirements.txt index 9d6b364ee36..61f1574fa1f 100644 --- a/examples/ios/requirements.txt +++ b/examples/ios/requirements.txt @@ -1,2 +1,2 @@ flwr~=1.4.0 -numpy~=1.21.1 +numpy~=1.24.3 diff --git a/examples/mxnet_from_centralized_to_federated/requirements.txt b/examples/mxnet_from_centralized_to_federated/requirements.txt index 4865e949538..5367010f8cf 100644 --- a/examples/mxnet_from_centralized_to_federated/requirements.txt +++ b/examples/mxnet_from_centralized_to_federated/requirements.txt @@ -1,3 +1,3 @@ flwr~=1.4.0 mxnet~=1.9.1 -numpy~=1.21.1 +numpy~=1.24.3 diff --git a/examples/opacus/requirements.txt b/examples/opacus/requirements.txt index e6e5dbb2fdf..0dc40da2924 100644 --- a/examples/opacus/requirements.txt +++ b/examples/opacus/requirements.txt @@ -1,4 +1,4 @@ flwr~=1.4.0 -numpy~=1.21.1 +numpy~=1.24.3 torch~=2.0.1 torchvision~=0.15.2 diff --git a/examples/pytorch_from_centralized_to_federated/requirements.txt b/examples/pytorch_from_centralized_to_federated/requirements.txt index e6e5dbb2fdf..0dc40da2924 100644 --- a/examples/pytorch_from_centralized_to_federated/requirements.txt +++ b/examples/pytorch_from_centralized_to_federated/requirements.txt @@ -1,4 +1,4 @@ flwr~=1.4.0 -numpy~=1.21.1 +numpy~=1.24.3 torch~=2.0.1 torchvision~=0.15.2 diff --git a/examples/quickstart_huggingface/requirements.txt b/examples/quickstart_huggingface/requirements.txt index 767eefed80b..322466936ac 100644 --- a/examples/quickstart_huggingface/requirements.txt +++ b/examples/quickstart_huggingface/requirements.txt @@ -1,6 +1,6 @@ datasets~=2.12.0 evaluate~=0.4.0 flwr~=1.4.0 -numpy~=1.21.1 +numpy~=1.24.3 torch~=2.0.1 -transformers~=4.29.1 +transformers~=4.29.2 diff --git a/examples/quickstart_jax/requirements.txt b/examples/quickstart_jax/requirements.txt index bf7a9c64d66..13e94d7ec17 100644 --- a/examples/quickstart_jax/requirements.txt +++ b/examples/quickstart_jax/requirements.txt @@ -1,4 +1,4 @@ flwr~=1.4.0 jax~=0.4.10 -numpy~=1.21.1 +numpy~=1.24.3 scikit_learn~=1.2.2 diff --git a/examples/quickstart_mxnet/requirements.txt b/examples/quickstart_mxnet/requirements.txt index 4865e949538..5367010f8cf 100644 --- a/examples/quickstart_mxnet/requirements.txt +++ b/examples/quickstart_mxnet/requirements.txt @@ -1,3 +1,3 @@ flwr~=1.4.0 mxnet~=1.9.1 -numpy~=1.21.1 +numpy~=1.24.3 diff --git a/examples/quickstart_pandas/requirements.txt b/examples/quickstart_pandas/requirements.txt index 994eed4fac0..3807d1a13c5 100644 --- a/examples/quickstart_pandas/requirements.txt +++ b/examples/quickstart_pandas/requirements.txt @@ -1,3 +1,3 @@ flwr~=1.4.0 -numpy~=1.21.1 +numpy~=1.24.3 pandas~=2.0.1 diff --git a/examples/simulation_pytorch/requirements.txt b/examples/simulation_pytorch/requirements.txt index 35cd1bdf092..98b14c922ae 100644 --- a/examples/simulation_pytorch/requirements.txt +++ b/examples/simulation_pytorch/requirements.txt @@ -1,6 +1,6 @@ flwr~=1.4.0 -numpy~=1.21.1 +numpy~=1.24.3 Pillow~=9.5.0 ray~=2.4.0 torch~=2.0.1 -torchvision~=0.15.2 \ No newline at end of file +torchvision~=0.15.2 diff --git a/examples/sklearn-logreg-mnist/requirements.txt b/examples/sklearn-logreg-mnist/requirements.txt index eec2e1a3c4b..aab295ec22e 100644 --- a/examples/sklearn-logreg-mnist/requirements.txt +++ b/examples/sklearn-logreg-mnist/requirements.txt @@ -1,4 +1,4 @@ flwr~=1.4.0 -numpy~=1.21.1 +numpy~=1.24.3 openml~=0.13.1 scikit_learn~=1.2.2 From 66bf4dca43fa79dc8eaf778af439a53f69cd930f Mon Sep 17 00:00:00 2001 From: danielnugraha Date: Tue, 23 May 2023 18:42:27 +0200 Subject: [PATCH 17/27] test code to check script --- dev/check-requirements-txt.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/check-requirements-txt.sh b/dev/check-requirements-txt.sh index 64aa20ce44c..40bfe99127a 100755 --- a/dev/check-requirements-txt.sh +++ b/dev/check-requirements-txt.sh @@ -22,6 +22,7 @@ cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/../ ./dev/generate-requirements-txt.sh # Fail if user forgot to sync requirements.txt and pyproject.toml +$(git diff --name-only HEAD examples) CHANGED=$(git diff --name-only HEAD examples) if [ -n "$CHANGED" ]; then From 58ce7c383ec47e571fcddb10849c49d81ee409a0 Mon Sep 17 00:00:00 2001 From: Taner Topal Date: Tue, 23 May 2023 21:48:47 +0200 Subject: [PATCH 18/27] Regenerate requirement txt files without .venv --- examples/android/requirements.txt | 2 +- examples/dp-sgd-mnist/requirements.txt | 2 +- examples/ios/requirements.txt | 2 +- examples/mxnet_from_centralized_to_federated/requirements.txt | 2 +- examples/opacus/requirements.txt | 2 +- .../pytorch_from_centralized_to_federated/requirements.txt | 2 +- examples/quickstart_huggingface/requirements.txt | 2 +- examples/quickstart_jax/requirements.txt | 2 +- examples/quickstart_mxnet/requirements.txt | 2 +- examples/quickstart_pandas/requirements.txt | 2 +- examples/simulation_pytorch/requirements.txt | 4 ++-- examples/sklearn-logreg-mnist/requirements.txt | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/examples/android/requirements.txt b/examples/android/requirements.txt index b4506379718..e75049b33f0 100644 --- a/examples/android/requirements.txt +++ b/examples/android/requirements.txt @@ -1 +1 @@ -numpy~=1.24.3 +numpy~=1.21.1 diff --git a/examples/dp-sgd-mnist/requirements.txt b/examples/dp-sgd-mnist/requirements.txt index d8ad03be876..fa51400e9e0 100644 --- a/examples/dp-sgd-mnist/requirements.txt +++ b/examples/dp-sgd-mnist/requirements.txt @@ -1,4 +1,4 @@ flwr~=1.4.0 -numpy~=1.24.3 +numpy~=1.21.1 tensorflow~=2.12.0 tensorflow_privacy~=0.8.9 diff --git a/examples/ios/requirements.txt b/examples/ios/requirements.txt index 61f1574fa1f..9d6b364ee36 100644 --- a/examples/ios/requirements.txt +++ b/examples/ios/requirements.txt @@ -1,2 +1,2 @@ flwr~=1.4.0 -numpy~=1.24.3 +numpy~=1.21.1 diff --git a/examples/mxnet_from_centralized_to_federated/requirements.txt b/examples/mxnet_from_centralized_to_federated/requirements.txt index 5367010f8cf..4865e949538 100644 --- a/examples/mxnet_from_centralized_to_federated/requirements.txt +++ b/examples/mxnet_from_centralized_to_federated/requirements.txt @@ -1,3 +1,3 @@ flwr~=1.4.0 mxnet~=1.9.1 -numpy~=1.24.3 +numpy~=1.21.1 diff --git a/examples/opacus/requirements.txt b/examples/opacus/requirements.txt index 0dc40da2924..e6e5dbb2fdf 100644 --- a/examples/opacus/requirements.txt +++ b/examples/opacus/requirements.txt @@ -1,4 +1,4 @@ flwr~=1.4.0 -numpy~=1.24.3 +numpy~=1.21.1 torch~=2.0.1 torchvision~=0.15.2 diff --git a/examples/pytorch_from_centralized_to_federated/requirements.txt b/examples/pytorch_from_centralized_to_federated/requirements.txt index 0dc40da2924..e6e5dbb2fdf 100644 --- a/examples/pytorch_from_centralized_to_federated/requirements.txt +++ b/examples/pytorch_from_centralized_to_federated/requirements.txt @@ -1,4 +1,4 @@ flwr~=1.4.0 -numpy~=1.24.3 +numpy~=1.21.1 torch~=2.0.1 torchvision~=0.15.2 diff --git a/examples/quickstart_huggingface/requirements.txt b/examples/quickstart_huggingface/requirements.txt index 322466936ac..697518c415b 100644 --- a/examples/quickstart_huggingface/requirements.txt +++ b/examples/quickstart_huggingface/requirements.txt @@ -1,6 +1,6 @@ datasets~=2.12.0 evaluate~=0.4.0 flwr~=1.4.0 -numpy~=1.24.3 +numpy~=1.21.1 torch~=2.0.1 transformers~=4.29.2 diff --git a/examples/quickstart_jax/requirements.txt b/examples/quickstart_jax/requirements.txt index 13e94d7ec17..bf7a9c64d66 100644 --- a/examples/quickstart_jax/requirements.txt +++ b/examples/quickstart_jax/requirements.txt @@ -1,4 +1,4 @@ flwr~=1.4.0 jax~=0.4.10 -numpy~=1.24.3 +numpy~=1.21.1 scikit_learn~=1.2.2 diff --git a/examples/quickstart_mxnet/requirements.txt b/examples/quickstart_mxnet/requirements.txt index 5367010f8cf..4865e949538 100644 --- a/examples/quickstart_mxnet/requirements.txt +++ b/examples/quickstart_mxnet/requirements.txt @@ -1,3 +1,3 @@ flwr~=1.4.0 mxnet~=1.9.1 -numpy~=1.24.3 +numpy~=1.21.1 diff --git a/examples/quickstart_pandas/requirements.txt b/examples/quickstart_pandas/requirements.txt index 3807d1a13c5..994eed4fac0 100644 --- a/examples/quickstart_pandas/requirements.txt +++ b/examples/quickstart_pandas/requirements.txt @@ -1,3 +1,3 @@ flwr~=1.4.0 -numpy~=1.24.3 +numpy~=1.21.1 pandas~=2.0.1 diff --git a/examples/simulation_pytorch/requirements.txt b/examples/simulation_pytorch/requirements.txt index 98b14c922ae..88d9c127b74 100644 --- a/examples/simulation_pytorch/requirements.txt +++ b/examples/simulation_pytorch/requirements.txt @@ -1,6 +1,6 @@ flwr~=1.4.0 -numpy~=1.24.3 +numpy~=1.21.1 Pillow~=9.5.0 -ray~=2.4.0 +ray~=2.3.1 torch~=2.0.1 torchvision~=0.15.2 diff --git a/examples/sklearn-logreg-mnist/requirements.txt b/examples/sklearn-logreg-mnist/requirements.txt index aab295ec22e..eec2e1a3c4b 100644 --- a/examples/sklearn-logreg-mnist/requirements.txt +++ b/examples/sklearn-logreg-mnist/requirements.txt @@ -1,4 +1,4 @@ flwr~=1.4.0 -numpy~=1.24.3 +numpy~=1.21.1 openml~=0.13.1 scikit_learn~=1.2.2 From ecf7e78d6f65995f459bc41e700260eded936ca8 Mon Sep 17 00:00:00 2001 From: Taner Topal Date: Tue, 23 May 2023 21:49:06 +0200 Subject: [PATCH 19/27] Ignore .venv when running pipreqs --- dev/generate-requirements-txt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/generate-requirements-txt.sh b/dev/generate-requirements-txt.sh index 2b509e516d0..89b6e5e9858 100755 --- a/dev/generate-requirements-txt.sh +++ b/dev/generate-requirements-txt.sh @@ -21,5 +21,5 @@ cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/../ # Purpose of this script is to regenerate requirements.txt for path in $(find ./examples -type f -name 'pyproject.toml' | sed -E 's|/[^/]+$||' |sort -u) do - pipreqs --mode 'compat' --force $path + pipreqs --mode 'compat' --force --ignore .venv,poetry.lock $path done From c12eee224c8762086d896a5fc17717413ed4c29b Mon Sep 17 00:00:00 2001 From: Taner Topal Date: Tue, 23 May 2023 22:12:23 +0200 Subject: [PATCH 20/27] Add code for debugging --- dev/generate-requirements-txt.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dev/generate-requirements-txt.sh b/dev/generate-requirements-txt.sh index 89b6e5e9858..9b0a4fd41de 100755 --- a/dev/generate-requirements-txt.sh +++ b/dev/generate-requirements-txt.sh @@ -21,5 +21,7 @@ cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/../ # Purpose of this script is to regenerate requirements.txt for path in $(find ./examples -type f -name 'pyproject.toml' | sed -E 's|/[^/]+$||' |sort -u) do + echo -e "\nRunning pipreqs for example in ${path}" + ls $path pipreqs --mode 'compat' --force --ignore .venv,poetry.lock $path done From a12f6997cb321da72d33c5eac682e086415b6b8d Mon Sep 17 00:00:00 2001 From: Taner Topal Date: Tue, 23 May 2023 23:26:33 +0200 Subject: [PATCH 21/27] Modify checking script to get debug output --- dev/check-requirements-txt.sh | 6 ++++-- dev/generate-requirements-txt.sh | 1 - 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dev/check-requirements-txt.sh b/dev/check-requirements-txt.sh index 40bfe99127a..4c532743518 100755 --- a/dev/check-requirements-txt.sh +++ b/dev/check-requirements-txt.sh @@ -19,10 +19,12 @@ set -e cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/../ # Regenerate requirements.txt files in case they changed -./dev/generate-requirements-txt.sh +./dev/generate-requirements-txt.sh 2> /dev/null + +pwd # Fail if user forgot to sync requirements.txt and pyproject.toml -$(git diff --name-only HEAD examples) +git diff --name-only HEAD examples CHANGED=$(git diff --name-only HEAD examples) if [ -n "$CHANGED" ]; then diff --git a/dev/generate-requirements-txt.sh b/dev/generate-requirements-txt.sh index 9b0a4fd41de..f78e368e9cf 100755 --- a/dev/generate-requirements-txt.sh +++ b/dev/generate-requirements-txt.sh @@ -22,6 +22,5 @@ cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/../ for path in $(find ./examples -type f -name 'pyproject.toml' | sed -E 's|/[^/]+$||' |sort -u) do echo -e "\nRunning pipreqs for example in ${path}" - ls $path pipreqs --mode 'compat' --force --ignore .venv,poetry.lock $path done From dab880ee5561bce9fa38585349623b0eec8a069e Mon Sep 17 00:00:00 2001 From: danielnugraha Date: Wed, 24 May 2023 08:43:23 +0200 Subject: [PATCH 22/27] change output for test --- dev/check-requirements-txt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/check-requirements-txt.sh b/dev/check-requirements-txt.sh index 4c532743518..ef99f86e59e 100755 --- a/dev/check-requirements-txt.sh +++ b/dev/check-requirements-txt.sh @@ -24,7 +24,7 @@ cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/../ pwd # Fail if user forgot to sync requirements.txt and pyproject.toml -git diff --name-only HEAD examples +git diff HEAD examples CHANGED=$(git diff --name-only HEAD examples) if [ -n "$CHANGED" ]; then From 7a395aa63b21e1c49022e93f5777710e144408f0 Mon Sep 17 00:00:00 2001 From: danielnugraha Date: Wed, 24 May 2023 08:53:10 +0200 Subject: [PATCH 23/27] regenerate requirements.txt --- examples/simulation_pytorch/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/simulation_pytorch/requirements.txt b/examples/simulation_pytorch/requirements.txt index 88d9c127b74..650b902c918 100644 --- a/examples/simulation_pytorch/requirements.txt +++ b/examples/simulation_pytorch/requirements.txt @@ -1,6 +1,6 @@ flwr~=1.4.0 numpy~=1.21.1 Pillow~=9.5.0 -ray~=2.3.1 +ray~=2.4.0 torch~=2.0.1 torchvision~=0.15.2 From eb82d2b53e62200954cd40e0bf6a483a15ba2253 Mon Sep 17 00:00:00 2001 From: danielnugraha Date: Wed, 24 May 2023 09:12:41 +0200 Subject: [PATCH 24/27] remove redundant output in script --- dev/check-requirements-txt.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/dev/check-requirements-txt.sh b/dev/check-requirements-txt.sh index ef99f86e59e..7c21aad5cc8 100755 --- a/dev/check-requirements-txt.sh +++ b/dev/check-requirements-txt.sh @@ -24,7 +24,6 @@ cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/../ pwd # Fail if user forgot to sync requirements.txt and pyproject.toml -git diff HEAD examples CHANGED=$(git diff --name-only HEAD examples) if [ -n "$CHANGED" ]; then From ff4680084cd5a77b69f4417719432941acb6597b Mon Sep 17 00:00:00 2001 From: Taner Topal Date: Wed, 24 May 2023 09:30:48 +0200 Subject: [PATCH 25/27] Update dev/check-requirements-txt.sh --- dev/check-requirements-txt.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/dev/check-requirements-txt.sh b/dev/check-requirements-txt.sh index 7c21aad5cc8..22d3acbc888 100755 --- a/dev/check-requirements-txt.sh +++ b/dev/check-requirements-txt.sh @@ -21,8 +21,6 @@ cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/../ # Regenerate requirements.txt files in case they changed ./dev/generate-requirements-txt.sh 2> /dev/null -pwd - # Fail if user forgot to sync requirements.txt and pyproject.toml CHANGED=$(git diff --name-only HEAD examples) From 498312d6e9540c0c963db88773a36fccf1d7a677 Mon Sep 17 00:00:00 2001 From: danielnugraha Date: Wed, 24 May 2023 12:49:11 +0200 Subject: [PATCH 26/27] add context to generate-requirements-txt --- dev/check-requirements-txt.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/check-requirements-txt.sh b/dev/check-requirements-txt.sh index 22d3acbc888..781a533ba1d 100755 --- a/dev/check-requirements-txt.sh +++ b/dev/check-requirements-txt.sh @@ -19,6 +19,7 @@ set -e cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/../ # Regenerate requirements.txt files in case they changed +echo "Regenerate requirements.txt files in case they changed" ./dev/generate-requirements-txt.sh 2> /dev/null # Fail if user forgot to sync requirements.txt and pyproject.toml From 8c8153c798d7ebc77560b59c770fe165b4486a7d Mon Sep 17 00:00:00 2001 From: danielnugraha Date: Wed, 24 May 2023 13:27:41 +0200 Subject: [PATCH 27/27] add more context to generate-requirements-txt --- dev/check-requirements-txt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/check-requirements-txt.sh b/dev/check-requirements-txt.sh index 781a533ba1d..e9e48a97867 100755 --- a/dev/check-requirements-txt.sh +++ b/dev/check-requirements-txt.sh @@ -18,7 +18,7 @@ set -e cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/../ -# Regenerate requirements.txt files in case they changed +# Regenerate requirements.txt files for examples in case they changed echo "Regenerate requirements.txt files in case they changed" ./dev/generate-requirements-txt.sh 2> /dev/null