6.1 Hello FV
What is Hello FV ?
Hello-FV 主要由python撰寫,讓開發者學習Ailabs's FV framework,Hello-FV使用MNIST作示範。
Getting started
請準備一個Ubuntu 20.04的環境,且docker環境已經被安裝好。
1.請從Pytorch官方下載MNIST資料集,或可經由我們的連結mnist_dataset.zip下載,下載完成請解壓縮,並將解壓縮後的MNIST資料夾放到/var/data下。
2.請下載Ailabs所提供MNIST的model weight,下載完請確認檔名為`model_weight.ckpt`並放在 `/var/model`底下,完整路徑即`/var/model/model_weight.ckpt`可讀取到MNIST's model weight。
3.在command line 輸入以下指令啟動Hello-FL已經預先build出來的image。
docker run -it --name hello-fv --runtime=nvidia \
-e NVIDIA_VISIBLE_DEVICES=0 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /bin/docker:/bin/docker \
-v /var/model/model_weight.ckpt:/model_weight.ckpt \
-v /var/data:/data \
-v /var:/var \
-v /var/output:/var/output \
-v /var/logs:/var/logs \
registry.corp.ailabs.tw/federated-learning/hello-fv/edge:1.1.1
我們所提供上述的啟動指令,其中幾個比較重要的參數意義如下
NVIDIA_VISIBLE_DEVICES=0 : A FV plan will need GPU to do validation, this value is the index of one of your GPU cards. Will
be 0 if the developer just has one GPU in his edge.
-v /var/data:/data : This is the path where the container load the datasets from.
-v /var/model/model_weight.ckpt:/model_weight.ckpt** : The location of model's weight. Put the MNIST's model weight
downloaded at **/var/model_weight.ckpt **.
-v /var/output:/var/output** : This is the path where the container output the result of validation (**result.json**).
-v /var/logs:/var/logs** : This is the path where the container outputs the logs of the developer's container. And
the progress of validation(**progress.json**) is also located here.