美文网首页
本科生毕设实验记录

本科生毕设实验记录

作者: 酵母小木 | 来源:发表于2021-05-17 17:01 被阅读0次

    1. 手写数字识别

    1.1. 训练配置设定

    from easydict import EasyDict as edict
    
    __C                           = edict()
    # Consumers can get config by: from config import cfg
    
    cfg                           = __C
    
    # YOLO options
    __C.YOLO                      = edict()
    
    # Set the class name
    __C.YOLO.CLASSES              = "./data/classes/yymnist.names"
    __C.YOLO.ANCHORS              = "./data/anchors/basline_anchors.txt"
    __C.YOLO.STRIDES              = [8, 16, 32]
    __C.YOLO.ANCHOR_PER_SCALE     = 3
    __C.YOLO.IOU_LOSS_THRESH      = 0.5
    
    # Train options
    __C.TRAIN                     = edict()
    
    __C.TRAIN.ANNOT_PATH          = "./data/dataset/yymnist_train.txt"
    __C.TRAIN.BATCH_SIZE          = 2
    # __C.TRAIN.INPUT_SIZE            = [320, 352, 384, 416, 448, 480, 512, 544, 576, 608]
    __C.TRAIN.INPUT_SIZE          = [416]
    __C.TRAIN.DATA_AUG            = True
    __C.TRAIN.LR_INIT             = 1e-3
    __C.TRAIN.LR_END              = 1e-6
    __C.TRAIN.WARMUP_EPOCHS       = 2
    __C.TRAIN.EPOCHS              = 5
    
    # TEST options
    __C.TEST                      = edict()
    
    __C.TEST.ANNOT_PATH           = "./data/dataset/yymnist_test.txt"
    __C.TEST.BATCH_SIZE           = 2
    __C.TEST.INPUT_SIZE           = 416
    __C.TEST.DATA_AUG             = False
    __C.TEST.DECTECTED_IMAGE_PATH = "./data/detection/"
    __C.TEST.SCORE_THRESHOLD      = 0.3
    __C.TEST.IOU_THRESHOLD        = 0.45
    
    • batch_size改为2,太大会导致内存溢出
    • 为了减少训练的总量和避免过拟合,将epochs设置为5
    • 训练过程开启了数据增强

    1.2. 数据集设置

    • 训练集1000张,测试集200张,训练总数为1000/2*5=2500回合
    • 训练时长2h

    2. ;两类机器人识别

    2.1. 训练配置设定

    from easydict import EasyDict as edict
    
    __C                           = edict()
    # Consumers can get config by: from config import cfg
    
    cfg                           = __C
    
    # YOLO options
    __C.YOLO                      = edict()
    
    # Set the class name
    # __C.YOLO.CLASSES              = "./data/classes/coco.names"
    # __C.YOLO.CLASSES              = "./data/classes/yymnist.names"
    # __C.YOLO.CLASSES              = "./data/classes/robot2.names"
    __C.YOLO.CLASSES              = "./data/classes/robot.names"
    __C.YOLO.ANCHORS              = "./data/anchors/basline_anchors.txt"
    __C.YOLO.STRIDES              = [8, 16, 32]
    __C.YOLO.ANCHOR_PER_SCALE     = 3
    __C.YOLO.IOU_LOSS_THRESH      = 0.5
    
    # Train options
    __C.TRAIN                     = edict()
    __C.TRAIN.ANNOT_PATH          = "./data/dataset/train.txt"
    __C.TRAIN.BATCH_SIZE          = 2
    # __C.TRAIN.INPUT_SIZE            = [320, 352, 384, 416, 448, 480, 512, 544, 576, 608]
    __C.TRAIN.INPUT_SIZE          = [416]
    __C.TRAIN.DATA_AUG            = True
    __C.TRAIN.LR_INIT             = 1e-3
    __C.TRAIN.LR_END              = 1e-6
    __C.TRAIN.WARMUP_EPOCHS       = 2
    __C.TRAIN.EPOCHS              = 2
    
    # TEST options
    __C.TEST                      = edict()
    
    __C.TEST.ANNOT_PATH           = "./data/dataset/test.txt"
    __C.TEST.BATCH_SIZE           = 2
    __C.TEST.INPUT_SIZE           = 416
    __C.TEST.DATA_AUG             = False
    __C.TEST.DECTECTED_IMAGE_PATH = "./data/detection/"
    __C.TEST.SCORE_THRESHOLD      = 0.3
    __C.TEST.IOU_THRESHOLD        = 0.45
    
    • batch_size改为2,太大会导致内存溢出
    • 为了减少训练的总量和避免过拟合,将epochs设置为5

    1.2. 数据集设置

    • 每一类训练集1500张,一共3000张,测试集250张,一共500张,训练总数为3000/3*2=2000回合

    3. 实验技巧

    3.1. 需要修改的文件

    # 配置文件的参数
    D:\JupyterProjects\TensorFlow2.0-Examples-master\4-Object_Detection\YOLOV3\core\config.py
    # 修改输入图片的尺寸
    D:\JupyterProjects\TensorFlow2.0-Examples-master\4-Object_Detection\YOLOV3\test.py
    

    相关文章

      网友评论

          本文标题:本科生毕设实验记录

          本文链接:https://www.haomeiwen.com/subject/hfbjjltx.html