From e67e4acfa260d441bff4542a276a2baf539cd9ed Mon Sep 17 00:00:00 2001 From: XinYao1994 Date: Fri, 23 Jul 2021 17:10:21 +0800 Subject: [PATCH] add configuration for yolo-v5 --- .../mistnet/client_yolo.yml | 171 ++++++++++++++++++ .../mistnet/server_yolo.yml | 171 ++++++++++++++++++ plato | 2 +- 3 files changed, 343 insertions(+), 1 deletion(-) create mode 100644 examples/federated_learning/mistnet/client_yolo.yml create mode 100644 examples/federated_learning/mistnet/server_yolo.yml diff --git a/examples/federated_learning/mistnet/client_yolo.yml b/examples/federated_learning/mistnet/client_yolo.yml new file mode 100644 index 000000000..23c7f8c96 --- /dev/null +++ b/examples/federated_learning/mistnet/client_yolo.yml @@ -0,0 +1,171 @@ +clients: + # Type + type: mistnet + + # The total number of clients + total_clients: 1 + + # The number of clients selected in each round + per_round: 1 + + # Should the clients compute test accuracy locally? + do_test: false + +server: + type: mistnet + + address: 127.0.0.1 + port: 7363 + +data: + # The training and testing dataset + datasource: YOLO + data_params: packages/yolov5/yolov5/data/coco128.yaml + + # Where the dataset is located + data_path: ./data/COCO + train_path: ./data/COCO/coco128/images/train2017/ + test_path: ./data/COCO/coco128/images/train2017/ + + # download command/URL (optional) + download_urls: + [ + "https://github.com/ultralytics/yolov5/releases/download/v1.0/coco128.zip", + ] + + # number of training examples + num_train_examples: 128 + + # number of testing examples + num_test_examples: 128 + + # number of classes + num_classes: 80 + + # image size + image_size: 640 + + # class names + classes: + [ + "person", + "bicycle", + "car", + "motorcycle", + "airplane", + "bus", + "train", + "truck", + "boat", + "traffic light", + "fire hydrant", + "stop sign", + "parking meter", + "bench", + "bird", + "cat", + "dog", + "horse", + "sheep", + "cow", + "elephant", + "bear", + "zebra", + "giraffe", + "backpack", + "umbrella", + "handbag", + "tie", + "suitcase", + "frisbee", + "skis", + "snowboard", + "sports ball", + "kite", + "baseball bat", + "baseball glove", + "skateboard", + "surfboard", + "tennis racket", + "bottle", + "wine glass", + "cup", + "fork", + "knife", + "spoon", + "bowl", + "banana", + "apple", + "sandwich", + "orange", + "broccoli", + "carrot", + "hot dog", + "pizza", + "donut", + "cake", + "chair", + "couch", + "potted plant", + "bed", + "dining table", + "toilet", + "tv", + "laptop", + "mouse", + "remote", + "keyboard", + "cell phone", + "microwave", + "oven", + "toaster", + "sink", + "refrigerator", + "book", + "clock", + "vase", + "scissors", + "teddy bear", + "hair drier", + "toothbrush", + ] + + # Number of samples in each partition + partition_size: 128 + + # IID or non-IID? + sampler: iid + +trainer: + # The type of the trainer + type: yolov5 + + # The maximum number of training rounds + rounds: 1 + + # Whether the training should use multiple GPUs if available + parallelized: false + + # The maximum number of clients running concurrently + max_concurrency: 3 + + # The target accuracy + target_accuracy: 0.99 + + # Number of epoches for local training in each communication round + epochs: 500 + batch_size: 16 + optimizer: SGD + linear_lr: false + + # The machine learning model + model_name: yolov5 + model_config: packages/yolov5/yolov5/models/yolov5s.yaml + train_params: packages/yolov5/yolov5/data/hyp.scratch.yaml + +algorithm: + # Aggregation algorithm + type: mistnet + + cut_layer: 4 + epsilon: 100 \ No newline at end of file diff --git a/examples/federated_learning/mistnet/server_yolo.yml b/examples/federated_learning/mistnet/server_yolo.yml new file mode 100644 index 000000000..c0dc4e3f1 --- /dev/null +++ b/examples/federated_learning/mistnet/server_yolo.yml @@ -0,0 +1,171 @@ +clients: + # Type + type: mistnet + + # The total number of clients + total_clients: 0 + + # The number of clients selected in each round + per_round: 1 + + # Should the clients compute test accuracy locally? + do_test: false + +server: + type: mistnet + + address: 127.0.0.1 + port: 7363 + +data: + # The training and testing dataset + datasource: YOLO + data_params: packages/yolov5/yolov5/data/coco128.yaml + + # Where the dataset is located + data_path: ./data/COCO + train_path: ./data/COCO/coco128/images/train2017/ + test_path: ./data/COCO/coco128/images/train2017/ + + # download command/URL (optional) + download_urls: + [ + "https://github.com/ultralytics/yolov5/releases/download/v1.0/coco128.zip", + ] + + # number of training examples + num_train_examples: 128 + + # number of testing examples + num_test_examples: 128 + + # number of classes + num_classes: 80 + + # image size + image_size: 640 + + # class names + classes: + [ + "person", + "bicycle", + "car", + "motorcycle", + "airplane", + "bus", + "train", + "truck", + "boat", + "traffic light", + "fire hydrant", + "stop sign", + "parking meter", + "bench", + "bird", + "cat", + "dog", + "horse", + "sheep", + "cow", + "elephant", + "bear", + "zebra", + "giraffe", + "backpack", + "umbrella", + "handbag", + "tie", + "suitcase", + "frisbee", + "skis", + "snowboard", + "sports ball", + "kite", + "baseball bat", + "baseball glove", + "skateboard", + "surfboard", + "tennis racket", + "bottle", + "wine glass", + "cup", + "fork", + "knife", + "spoon", + "bowl", + "banana", + "apple", + "sandwich", + "orange", + "broccoli", + "carrot", + "hot dog", + "pizza", + "donut", + "cake", + "chair", + "couch", + "potted plant", + "bed", + "dining table", + "toilet", + "tv", + "laptop", + "mouse", + "remote", + "keyboard", + "cell phone", + "microwave", + "oven", + "toaster", + "sink", + "refrigerator", + "book", + "clock", + "vase", + "scissors", + "teddy bear", + "hair drier", + "toothbrush", + ] + + # Number of samples in each partition + partition_size: 128 + + # IID or non-IID? + sampler: iid + +trainer: + # The type of the trainer + type: yolov5 + + # The maximum number of training rounds + rounds: 1 + + # Whether the training should use multiple GPUs if available + parallelized: false + + # The maximum number of clients running concurrently + max_concurrency: 3 + + # The target accuracy + target_accuracy: 0.99 + + # Number of epoches for local training in each communication round + epochs: 500 + batch_size: 16 + optimizer: SGD + linear_lr: false + + # The machine learning model + model_name: yolov5 + model_config: packages/yolov5/yolov5/models/yolov5s.yaml + train_params: packages/yolov5/yolov5/data/hyp.scratch.yaml + +algorithm: + # Aggregation algorithm + type: mistnet + + cut_layer: 4 + epsilon: 100 \ No newline at end of file diff --git a/plato b/plato index 9978357a8..677b53b8b 160000 --- a/plato +++ b/plato @@ -1 +1 @@ -Subproject commit 9978357a8cc285272596161ed7999d59b0308859 +Subproject commit 677b53b8b9738ad5ecbd37d438d6e5265d360bd6