Training paddle-paddle model based on ai studio

 1. Create an item

1. On the ai studio interface, click Personal Center→Project→Create and Fork Project→Create Project
2. Project Information

① Select the type, Notebook

②Configuration environment, Notebook version: BML Codelab; project framework: PaddlePaddle2.x; project environment does not need to be selected

③Project description, the information you fill in can be freely selected; Regarding the data set, the data set provided by the platform is used to add the data set, and the own data set is used to create the data set

3. Page information

 ①Click + to add a terminal

②The content under the data folder will not be saved, except for the data set provided by the platform

2. Start training

1. Training environment preparation
# 更换当前路径
cd /home/aistudio/work

# 下载PaddleDetection代码
git clone https://gitee.com/paddlepaddle/PaddleDetection

# 下载依赖
pip install -r PaddleDetection/requirements.txt

# 下载 pycocotools
pip insatll pycocotools
 2. Dataset
# 解压数据
unzip -o /home/aistudio/data/data50329/HelmetDetection.zip -d PaddleDetection/dataset/ #第一个是数据集压缩包的路径,第二个是解压后的位置

 If the data set is not in voc format, it needs to be converted to voc format. The voc format can put the pictures in the same folder, but the txt file should be in a different folder.

3. Modify the training configuration file

①The classes in the /home/aistudio/work/PaddleDetection/dataset/voc/label_list.txt file should be modified to a collection of all classes marked by our dataset

②The number of tags in the /home/aistudio/work/PaddleDetection/configs/datasets/voc.yml file is 3, the dataset_dir is , and the anno_path is changed to train.txt (the one we created before is train.txt)

③/home/aistudio/work/PaddleDetection/configs/picodet/picodet_s_416_coco_lcnet.yml  

_BASE_ is modified to: ../datasets/voc.yml  

pretrain_weights modified to: https://paddledet.bj.bcebos.com/models/picodet_s_416_coco_lcnet.pdparams (pre-training weights)

4. Training model
python PaddleDetection/tools/train.py -c PaddleDetection/configs/datasets/voc.yml

Guess you like

Origin blog.csdn.net/this_dudu/article/details/132189454