Skip to content

Latest commit

 

History

History
51 lines (33 loc) · 1.84 KB

README.md

File metadata and controls

51 lines (33 loc) · 1.84 KB

Hello PyTorch

Example of using NVIDIA FLARE to train an image classifier using federated averaging (FedAvg) and PyTorch as the deep learning training framework.

NOTE: This example uses the CIFAR-10 dataset and will load its data within the client train code.

You can follow the Getting Started with NVFlare (PyTorch) notebook for a detailed walkthrough of the basic concepts.

See the Hello PyTorch example documentation page for details on this example.

To run this example with the FLARE API, you can follow the hello_world notebook, or you can quickly get started with the following:

1. Install NVIDIA FLARE

Follow the Installation instructions to install NVFlare.

Install additional requirements (if you already have a specific version of nvflare installed in your environment, you may want to remove nvflare in the requirements to avoid reinstalling nvflare):

pip3 install -r requirements.txt

2. Run the experiment

Run the script using the job API to create the job and run it with the simulator:

python3 fedavg_script_runner_pt.py

3. Access the logs and results

You can find the running logs and results inside the simulator's workspace:

$ ls /tmp/nvflare/jobs/workdir/

By default, the Tensorboard event logs can be found in the directory for each client on the server job's tb_events folder, for example:

$ ls /tmp/nvflare/jobs/workdir/server/simulate_job/tb_events/site-1
events.out.tfevents.1728070846.machinename.15928.1