Apache License 2.0

项目介绍

sipeed/maix_train 是一个托管在 GitHub 上的开源项目,主要使用 Python 编写,采用 Apache License 2.0 许可证,目前获得 84 个 Star、40 次 Fork。

仓库全名
sipeed/maix_train
开源许可证
Apache License 2.0
Star 数
84
Fork 数
40
未关闭 Issue
18

README 摘要

trainscripts =========== You can also train on Maixhub.com, just upload your datasets and you will get the result(kmodel and usage code) Train type Object classification(Mobilenet V1): judge class of image Object detection(YOLO v2): find a recognizable object in the picture Usage 0. Prepare only support Linux Prepare environment, use CPU or GPU to train At your fist time train, CPU is recommended, just or use…

完整内容见 GitHub 原始 README 或本页 。

常见问题

maix_train 用什么语言开发?

主要使用 Python 编写,采用 Apache License 2.0 许可证,目前有 84 个 Star。

maix_train 可以免费商用吗?

仓库采用 Apache License 2.0 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 maix_train 的源码?

可以直接克隆仓库:git clone https://github.com/sipeed/maix_train.git,默认分支为 master;安装与运行步骤见仓库 README。

maix_train 最近还在维护吗?

仓库最近一次更新为 2021年11月6日,当前有 18 个未关闭 Issue;Star 数为 84,可作为社区活跃度的参考。

关于

k210(MaixPy)/V831 model example train code, include mobilenet classifier and YOLO V2 detector

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

简要分析

热度分
171
价值分
62
活跃状态
活跃

语言占比

Python

README

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

  • Object classification(Mobilenet V1): judge class of image
  • Object detection(YOLO v2): find a recognizable object in the picture

Usage

0. Prepare

  • only support Linux
  • Prepare environment, use CPU or GPU to train At your fist time train, CPU is recommended, just
pip3 install -r requirements.txt

or use aliyun’s source if you are in China

pip3 install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
  • Download nncase and unzip it to tools/ncc/ncc_v0.1, and the executable path is tools/ncc/ncc_v0.1/ncc
  • python3 train.py init
  • Edit instance/config.py according to your hardware
  • Prepare dataset, in the datasets directory has some example datasets, input size if 224x224 or you just fllow maixhub’s conduct

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 (或者可以参考这篇教程)

docker pull neucrack/tensorflow-gpu-py3-jupyterlab

or

docker pull daocloud.io/neucrack/tensorflow-gpu-py3-jupyterlab
  • Test environment
docker run --gpus all -it --rm neucrack/tensorflow-gpu-py3-jupyterlab python -c "import tensorflow as tf; print('-----version:{}, gpu:{}, 1+2={}'.format(tf.__version__, tf.test.is_gpu_available(), tf.add(1, 2).numpy()) );"

if output is-----version:2.1.0, gpu:True, 1+2=3, that’s ok(maybe version can > 2.1.0)

  • Create docker container
docker run --gpus all --name jupyterlab-gpu -it -p 8889:8889 -e USER_NAME=$USER -e USER_ID=`id -u $USER` -e GROUP_NAME=`id -gn $USER` -e GROUP_ID=`id -g $USER` -v /home/${USER}:/tf neucrack/tensorflow-gpu-py3-jupyterlab

If used daocloud, image name should be change to daocloud.io/neucrack/tensorflow-gpu-py3-jupyterlab

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
  • use jupyterlab

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

评论

暂无评论