Tutorial for getting started with FEDn in Windows
- Go to python's official page https://www.python.org/ftp/python/3.12.6/python-3.12.6-amd64.exe to download the latest release for windows
- Click on the downloaded executable installer file to start installation
- Open Windows PowerShell, and test your new python install by running:
python --version
if this does not work or if it shows you a earlier version than <3.12.6, you need to add the python install folder into you PATH environment variable: REPLACE
$env:Path += ';C:\Users\<Username>\AppData\Local\Programs\Python\Python312\'
Try again:
python --version
- Next, make sure the python package manager "pip" is installed and is pointing to the correct python version (3.12):
pip --version
- Create a python virtual environment (to avoid changing system wide python dependencies):
python -m venv .venv
A new folder ".venv" should have been created. Activate the new venv:
.venv/Scripts/Activate.ps1
OBS! If you get a permission denied error, it means your user don't have the right permissions to run scripts in the PowerShell environment. Either try to run PowerShell as Admin or in CMD.exe run:
.venv/Scripts/activate.bat
You know that the venv is activated when is says (.venv) in the beginning of the command line. 6. Install Scaleout software FEDn by running:
pip install fedn
- Test fedn:
fedn --version
- Sign-up at https://fedn.scaleoutsystems.com
- In the "Project" for the workshop go to "clients" in the sidebar and click "Connect client". Click the "Download" button. A "client.yaml" file should be located in your downloads folder.
- Make sure you have the venv activated (see step 5)
- Make a new folder:
mkdir demo
cd demo
- Copy or move the downloaded "client.yaml" into the "demo" folder.
- Start the fedn client:
fedn client start -in client.yaml --secure=True --force-ssl
- Clone the fedn repository:
git clone https://github.com/scaleoutsystems/fedn.git
- Move into the mnist-pytorch example:
cd fedn\examples\mnist-pytorch
- Run the "build" entrypoint of the project:
fedn run build -p client --keep-venv
This command will create and compile the pytoch model needed as the initial model/seed of the federated workflow.
- Next lets run the startup entrypoint, this entrypoint always runs at client startup:
fedn run startup -p client
This will fetch the training data needed for the client in this example.
- Finally lets test the train entrypoint:
fedn run train -p -i seed.npz -o updated_model.npz
This command will test the train entrypoint why passing the seed model as input and updated_model.npz as the new updated (trained) model.