Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated federated learning project for CPU compatibility and library upgrades #49

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

import-sisi
Copy link

In this Pull Request, the following changes have been made to improve CPU compatibility and upgrade the library versions used in the project:

Library Version Upgrades:

The libraries used in the requirments.txt file have been upgraded to newer versions. Key updates include:
PyTorch has been updated from version 1.2.0 to a more recent version that is compatible with modern environments.
Torchvision and other dependencies have also been upgraded to the latest versions.
The tensorboardX library has been replaced with torch.utils.tensorboard to ensure compatibility with the new version of PyTorch.
CPU Compatibility:

The project has been optimized to run on systems that only have a CPU, rather than requiring a GPU by default.
In the files federated_main.py and update.py, the device handling has been modified to use cpu instead of cuda.
Ensured that the model and data are correctly transferred to the appropriate device (CPU) using global_model.to(device) and model.to(device) in all relevant parts of the code.
Fixing PyTorch Warnings:

Adjustments were made to the use of torch.tensor() to address warnings related to newer versions of PyTorch, such as recommending .clone().detach() for tensor construction.
Tuning Learning Rate and Other Parameters:

The learning rate and training parameters were adjusted to ensure optimal performance in environments without GPU access, such as running the project on Google Colab with CPU.
Avoiding Issues Related to Missing NVIDIA Drivers:

The project was modified to run solely on CPU, which eliminates errors related to missing CUDA or NVIDIA drivers that could occur on systems without GPU support.
These changes allow the project to:

Run smoothly in modern environments with the updated versions of PyTorch and other libraries.
Execute on CPU without requiring a GPU, fixing any issues related to CUDA or NVIDIA driver dependencies.
Please review these changes and, if approved, merge them into the main repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant