Skip to content

Commit

Permalink
add correct params exchange format for tf script executor (#2676)
Browse files Browse the repository at this point in the history
  • Loading branch information
SYangster committed Jun 28, 2024
1 parent 35cfd33 commit 5af986a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions examples/getting_started/tf/nvflare_tf_getting_started.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,12 @@
"metadata": {},
"outputs": [],
"source": [
"from nvflare.client.config import ExchangeFormat\n",
"\n",
"for i in range(n_clients):\n",
" executor = ScriptExecutor(\n",
" task_script_path=\"src/cifar10_tf_fl.py\", task_script_args=\"\" # f\"--batch_size 32 --data_path /tmp/data/site-{i}\"\n",
" params_exchange_format=ExchangeFormat.NUMPY,\n",
" )\n",
" job.to(executor, f\"site-{i}\", gpu=0)"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from src.tf_net import TFNet

from nvflare import FedAvg, FedJob, ScriptExecutor
from nvflare.client.config import ExchangeFormat

if __name__ == "__main__":
n_clients = 2
Expand All @@ -36,7 +37,9 @@
# Add clients
for i in range(n_clients):
executor = ScriptExecutor(
task_script_path=train_script, task_script_args="" # f"--batch_size 32 --data_path /tmp/data/site-{i}"
task_script_path=train_script,
task_script_args="", # f"--batch_size 32 --data_path /tmp/data/site-{i}"
params_exchange_format=ExchangeFormat.NUMPY,
)
job.to(executor, f"site-{i}", gpu=0)

Expand Down

0 comments on commit 5af986a

Please sign in to comment.