文件结构调整
This commit is contained in:
parent
ba4508507b
commit
310131d876
@ -69,7 +69,7 @@ def federated_avg(global_model, client_weights):
|
|||||||
def federated_train(num_rounds, clients_data):
|
def federated_train(num_rounds, clients_data):
|
||||||
# 初始化全局模型
|
# 初始化全局模型
|
||||||
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
||||||
global_model = YOLO("yolov8n.pt").to(device)
|
global_model = YOLO("../yolov8n.pt").to(device)
|
||||||
# 设置类别数
|
# 设置类别数
|
||||||
global_model.model.nc = 1
|
global_model.model.nc = 1
|
||||||
|
|
||||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user