SMILELab-FL / FedLab

A flexible Federated Learning Framework based on PyTorch, simplifying your Federated Learning research.
https://fedlab.readthedocs.io
Apache License 2.0
740 stars 127 forks source link

Seaborn dependency not specified #347

Closed techwizrd closed 10 months ago

techwizrd commented 10 months ago

Describe the bug from fedlab.contrib.algorithm.basic_client import SGDSerialClientTrainer fails with ModuleNotFoundError: no module named 'seaborn'.

This is because fedlab.utils.dataset.functional imports seaborn and matplotlib for use in the feddate_scatterplot() function, but the dependency is not specified in install_requires in setup.py.

Environment Environment you use when bug appears:

  1. Python version: Python 3.11.4
  2. PyTorch Version: PyTorch 2.1.2+cpu
  3. FedLab version: fedlab 49cf058

Additional context Since seaborn and matplotlib are only used for those two functions, the import should be move into those functions and seaborn should be marked as an optional dependency.

techwizrd commented 10 months ago

It looks like this bug was introduced in f6960bb9eecc9156d19faa502faf84fe6ce8bd85.

AgentDS commented 10 months ago

yeah, you are right. I just fix it by adding seaborn in setup.py and requirements.txt. Thank you!