Open ibad321 opened 3 months ago
Hi, please see this issue: https://github.com/SMILELab-FL/FedLab/issues/352
Hi, please see this issue: #352
thanks for response i did this changes but the error Remain same i am using Ubuntu OS and i have no Gpu on working Machine
Here is below Screen shot
Please set cuda=False
at line 41 for the server handler.
Please set
cuda=False
at line 41 for the server handler.
Thanks Again for response Now give this error when i did the above changes.
Please set
cuda=False
at line 41 for the server handler.Thanks Again for response Now give this error when i did the above changes.
This is a bit weird cause we have set cuda=False
as default for the server handler in our codes.
Could you please just remove the cuda=False
part in line 41? Then save the script and run the launch.sh again. Let's see what happens.
Please set
cuda=False
at line 41 for the server handler.Thanks Again for response Now give this error when i did the above changes.
This is a bit weird cause we have set
cuda=False
as default for the server handler in our codes. Could you please just remove thecuda=False
part in line 41? Then save the script and run the launch.sh again. Let's see what happens.
Thanks for response i did the change but issue not resolved Here below is Screenshot
It seems to be a bug. I am working on fixing it. Please replace the standalone.py with the codes below and rerun it:
from json import load
import os
import argparse
import random
from copy import deepcopy
import torchvision
import torchvision.transforms as transforms
from torch import nn
import sys
import torch
sys.path.append("../../")
torch.manual_seed(0)
from fedlab.utils.aggregator import Aggregators
from fedlab.utils.serialization import SerializationTool
from fedlab.utils.functional import evaluate, get_best_gpu
from fedlab.models.mlp import MLP
from fedlab.contrib.algorithm.basic_server import SyncServerHandler
from fedlab.contrib.algorithm.basic_client import SGDSerialClientTrainer
from fedlab.core.standalone import StandalonePipeline
from fedlab.contrib.dataset.pathological_mnist import PathologicalMNIST
# configuration
parser = argparse.ArgumentParser(description="Standalone training example")
parser.add_argument("--total_clients", type=int, default=100)
parser.add_argument("--com_round", type=int)
parser.add_argument("--sample_ratio", type=float)
parser.add_argument("--batch_size", type=int)
parser.add_argument("--epochs", type=int)
parser.add_argument("--lr", type=float)
args = parser.parse_args()
model = MLP(784, 10)
# server
handler = SyncServerHandler(
model, args.com_round, args.sample_ratio
)
# client
trainer = SGDSerialClientTrainer(model, args.total_clients, cuda=False)
dataset = PathologicalMNIST(
root="../../datasets/mnist/",
path="../../datasets/mnist/",
num_clients=args.total_clients,
)
dataset.preprocess()
trainer.setup_dataset(dataset)
trainer.setup_optim(args.epochs, args.batch_size, args.lr)
handler.num_clients = args.total_clients
handler.setup_dataset(dataset)
# main
pipeline = StandalonePipeline(handler, trainer)
pipeline.main()
It seems to be a bug. I am working on fixing it. Please replace the standalone.py with the codes below and rerun it:
from json import load import os import argparse import random from copy import deepcopy import torchvision import torchvision.transforms as transforms from torch import nn import sys import torch sys.path.append("../../") torch.manual_seed(0) from fedlab.utils.aggregator import Aggregators from fedlab.utils.serialization import SerializationTool from fedlab.utils.functional import evaluate, get_best_gpu from fedlab.models.mlp import MLP from fedlab.contrib.algorithm.basic_server import SyncServerHandler from fedlab.contrib.algorithm.basic_client import SGDSerialClientTrainer from fedlab.core.standalone import StandalonePipeline from fedlab.contrib.dataset.pathological_mnist import PathologicalMNIST # configuration parser = argparse.ArgumentParser(description="Standalone training example") parser.add_argument("--total_clients", type=int, default=100) parser.add_argument("--com_round", type=int) parser.add_argument("--sample_ratio", type=float) parser.add_argument("--batch_size", type=int) parser.add_argument("--epochs", type=int) parser.add_argument("--lr", type=float) args = parser.parse_args() model = MLP(784, 10) # server handler = SyncServerHandler( model, args.com_round, args.sample_ratio ) # client trainer = SGDSerialClientTrainer(model, args.total_clients, cuda=False) dataset = PathologicalMNIST( root="../../datasets/mnist/", path="../../datasets/mnist/", num_clients=args.total_clients, ) dataset.preprocess() trainer.setup_dataset(dataset) trainer.setup_optim(args.epochs, args.batch_size, args.lr) handler.num_clients = args.total_clients handler.setup_dataset(dataset) # main pipeline = StandalonePipeline(handler, trainer) pipeline.main()
Thanks Again for Responce i did the changes mean copy the standalone.py and Paste Now give me the below error And Here is Line 57 Code handler.setup_dataset(dataset)
pipeline = StandalonePipeline(handler, trainer) pipeline.main()
Sorry for the late reply.
The example codes are adapted to the latest version of FedLab. Please try download the source code of the main branch and run it locally.
Sorry for the late reply.
The example codes are adapted to the latest version of FedLab. Please try download the source code of the main branch and run it locally.
Thanks for responce we download the aource code from release-v1.3.0 and than inside the examples/standalone-mnist/standalone.py change 41 line to cuda = False due to no Gpu now give this output what is mean As it successfully run or Again issue. Here is Screen shot
Please try the master branch via git clone https://github.com/SMILELab-FL/FedLab.git
Please try the master branch via
git clone https://github.com/SMILELab-FL/FedLab.git
Thanks for Responce Now i clone Exit the link git clone https://github.com/SMILELab-FL/FedLab.git and then installed the requiremnt pip install -r requirements.txt and than pip install fedlab==1.3.0 and no changes same thing run and Got this error. Note cuda=False when when we exute the code Here is below screen Shot
Please do not run pip install fedlab==1.3.0
. Because you have downloaded the source code. Just run the script directly.
Please do not run
pip install fedlab==1.3.0
. Because you have downloaded the source code. Just run the script directly.
Thanks again for response Now i delete the old folder and create new folder inside new folder clone the git clone https://github.com/SMILELab-FL/FedLab.git and the requirement are already installed in our system and did not exute this command as follow your instruction pip install fedlab==1.3.0 but Again same Issue you can see the folder name on Screen shot Here is Screen shot of New folder
Please replace line 57 with handler.dataset = dataset
handler.dataset = dataset
Thanks for response when i change the line57 got this output As this is actual Output or Some issue again
It works for me. Please make sure you have removed fedlab 1.3.0 from your python env.
It works for me. Please make sure you have removed fedlab 1.3.0 from your python env.
Thanks Again for your responce i follow your Instruction now give this output
It works for me. Please make sure you have removed fedlab 1.3.0 from your python env.
Thanks if this issue resolve i paste the Screenshot above Comment Please solve look it the #355 Issue Its give the same Error When we follow the Above Instruction.
@dunzeng Thanks If the Issue is Resolved and my output is Correct than i closed the issue.
Fedlab version =1.3.0 python version =Python 3.10.12 torch=1.7.1 torchvision=0.8.2 No Gpu i am running on laptop corei5 12th Generation Cpu
Got the below error when i try to run example standalone-minist