wenh06 / fl-sim

A Simple Simulation Framework for Federated Learning Based on PyTorch
MIT License
6 stars 1 forks source link

Vizualization documentation #4

Closed ToddRosenkrantz closed 4 months ago

ToddRosenkrantz commented 4 months ago

Could you provide a few lines of example documentation to produce the visualizations? When I run 'python viz.py', I get errors, including '..node Node' cannot be imported.

This is from inside the container after running 'fl-sim example-configs/fedavg-femnist.yml'

Any assistance is appreciated.

wenh06 commented 4 months ago

The Panel class in this file is typically used in a Jupyter notebook. It requires ipywidgets >= 8 (perhaps needs nodejs installed).

It's highly recommended to run a notebook server (has updates but not required) on some Linux (Ubuntu) machine via (for example)

nohup jupyter notebook --no-browser > ~/Jupyter/jupyter.log 2>&1 & echo $! > ~/Jupyter/jupyter.pid

and use this visualization Panel in a browser (e.g. Chrome, Edge, etc.).

ToddRosenkrantz commented 4 months ago

Thank you. Your answer provided me enough information to reinstall, add Jupyter and subsequently provide graphical data.

ToddRosenkrantz commented 4 months ago

once Jupyter is installed: in a new notebook, add two cells.

[1] from fl_sim.utils.viz import Panel [2] p = Panel()

This issue should be considered closed.