支持后台运行并记录日志
This commit is contained in:
@@ -30,7 +30,7 @@ def fed_run():
|
||||
# For convenience we pass the same `params` dict used by Dataset/model/loss.
|
||||
# Here we re-use the top-level cfg directly as params.
|
||||
# params = dict(cfg)
|
||||
|
||||
|
||||
if "names" in cfg and isinstance(cfg["names"], dict):
|
||||
# Convert {0: 'uav', 1: 'car', ...} to list if you prefer list
|
||||
# but we can leave dict; your utils appear to accept dict
|
||||
@@ -44,12 +44,12 @@ def fed_run():
|
||||
train_txt = cfg.get("train_txt", "")
|
||||
if not train_txt:
|
||||
ds_root = cfg.get("dataset_path", "")
|
||||
guess = os.path.join(ds_root, "train.txt") if ds_root else ""
|
||||
guess = os.path.join(ds_root, "train2017.txt") if ds_root else ""
|
||||
train_txt = guess
|
||||
|
||||
if not train_txt or not os.path.exists(train_txt):
|
||||
raise FileNotFoundError(
|
||||
f"train.txt not found. Provide --config with 'train_txt' or ensure '{train_txt}' exists."
|
||||
f"train2017.txt not found. Provide --config with 'train_txt' or ensure '{train_txt}' exists."
|
||||
)
|
||||
|
||||
split = divide_trainset(
|
||||
@@ -76,7 +76,7 @@ def fed_run():
|
||||
|
||||
# --- build server & optional validation set ---
|
||||
server = FedYoloServer(client_list=users, model_name=model_name, params=cfg)
|
||||
valset = build_valset_if_available(cfg, params=cfg, args=args_cli)
|
||||
valset = build_valset_if_available(cfg, params=cfg, args=args_cli, val_name="val2017")
|
||||
# valset is a Dataset class, not data loader
|
||||
if valset is not None:
|
||||
server.load_valset(valset)
|
||||
|
Reference in New Issue
Block a user