diff --git a/openfl/interface/interactive_api/experiment.py b/openfl/interface/interactive_api/experiment.py index 111c6f1238..d8096df8ad 100644 --- a/openfl/interface/interactive_api/experiment.py +++ b/openfl/interface/interactive_api/experiment.py @@ -15,8 +15,6 @@ from shutil import copytree, ignore_patterns, make_archive from typing import Dict, Tuple -from tensorboardX import SummaryWriter - from openfl.component.assigner.tasks import Task, TrainTask, ValidateTask from openfl.federated import Plan from openfl.interface.aggregation_functions import AggregationFunction, WeightedAverage @@ -206,6 +204,8 @@ def stream_metrics(self, tensorboard_logs: bool = True) -> None: def write_tensorboard_metric(self, metric: dict) -> None: """Write metric callback.""" if not self.summary_writer: + from tensorboardX import SummaryWriter + self.summary_writer = SummaryWriter(f"./logs/{self.experiment_name}", flush_secs=5) self.summary_writer.add_scalar( diff --git a/setup.py b/setup.py index 16fc7cad5f..3340e9a487 100644 --- a/setup.py +++ b/setup.py @@ -68,28 +68,23 @@ def run(self): url='https://github.com/securefederatedai/openfl', packages=find_packages(include=("openfl", "openfl.*", "openfl-docker", "openfl-workspace")), include_package_data=True, - setup_requires=['grpcio-tools>=1.56.2,<1.66.0'], + setup_requires=['grpcio-tools>=1.56.2,<1.66.0'], # ensure it is in-sync with `install_requires` install_requires=[ - 'Click==8.1.7', - 'PyYAML>=5.4.1', - 'cloudpickle', - 'cryptography>=3.4.6', - 'docker', - 'dynaconf==3.2.6', - 'flatten_json', - 'grpcio>=1.56.2,<1.66.0', - 'ipykernel', - 'jupyterlab', + 'click', + 'psutil', + 'pyyaml', + 'rich', + 'dynaconf', + 'tqdm', 'numpy', + 'requests', + 'cloudpickle', + 'cryptography', 'pandas', - 'protobuf>=4.22,<6.0.0', - 'pyzmq<=26.2.0', - 'requests>=2.32.0', - 'rich', 'scikit-learn', - 'tensorboard', - 'tensorboardX>=2.6', - 'tqdm', + 'flatten_json', + 'protobuf>=4.22,<6.0.0', + 'grpcio>=1.56.2,<1.66.0', ], python_requires='>=3.8, <3.12', project_urls={