sipeed / maix_train

k210(MaixPy)/V831 model example train code, include mobilenet classifier and YOLO V2 detector
https://wiki.sipeed.com/maixpy
Apache License 2.0
83 stars 40 forks source link
k210 kmodel maixhub maixpy mobilenet model train yolo

train_scripts

You can also train on Maixhub.com, just upload your datasets and you will get the result(kmodel and usage code)

Train type

Usage

0. Prepare

1. Object classification (Mobilenet V1)

python3 train.py -t classifier -z datasets/test_classifier_datasets.zip train

or assign datasets directory

python3 train.py -t classifier -d datasets/test_classifier_datasets train

more command seepython3 train.py -h

and you will see output in the out directory, packed as a zip file

2. Object detection (YOLO V2)

python3 train.py -t detector -z datasets/test_detector_xml_format.zip train

more command seepython3 train.py -h

and you will see output in the out directory, packed as a zip file

Use GPU

Use docker or install tensorflow with GPU in your local environment

Tensorflow's version should >= 2.0, tested on 2.1

Use docker(recommend)

see tensorflow official website (或者可以参考这篇教程)

This will mount your/home/$USER directory to /tf directory of container, the /tf is the root dir of jupyterlab

Stop by docker stop jupyterlab-gpu, start again by docker start jupyterlab-gpu To use sudo command, edit user password by

docker exec -it jupyterlab_gpu /bin/bash
passwd $USER
passwd root

Open http://127.0.0.1:8889/lab? in browser, input token(see docker start log) and set new password

Use docker stop jupyterlab-gpu to stop server Use docker start jupyterlab-gpu to start service again

Install on local environment

refer to tensorflow official website

License

Apache 2.0, see LICENSE