PaddleDetection icon indicating copy to clipboard operation
PaddleDetection copied to clipboard

在windows中训练 ssdlite_moboilenet_v3_small 出现的问题

Open dengxinlong opened this issue 5 years ago • 6 comments

X_C)4PY4%}BGO1PAH)6FFNX 问题截图 如上:

配置如下: 系统:windows10 python: 3.7 1080Ti cuda: 10.1

我的配置文件如下:

architecture: SSD
use_gpu: true
max_iters: 120000
snapshot_iter: 20000
log_iter: 20
metric: VOC
pretrain_weights: pretrainWeights/MobileNetV3_small_x1_0_ssld_pretrained
save_dir: output
weights: output/ssdlite_mobilenet_v3_small/best_model
# 80(label_class) + 1(background)
num_classes: 21

SSD:
  backbone: MobileNetV3
  multi_box_head: SSDLiteMultiBoxHead
  output_decoder:
    background_label: 0
    keep_top_k: 200
    nms_eta: 1.0
    nms_threshold: 0.45
    nms_top_k: 400
    score_threshold: 0.01

MobileNetV3:
  scale: 1.0
  model_name: small
  extra_block_filters: [[256, 512], [128, 256], [128, 256], [64, 128]]
  feature_maps: [5, 7, 8, 9, 10, 11]
  lr_mult_list: [0.25, 0.25, 0.5, 0.5, 0.75]
  conv_decay: 0.00004
  multiplier: 0.5

SSDLiteMultiBoxHead:
  aspect_ratios: [[2.], [2., 3.], [2., 3.], [2., 3.], [2., 3.], [2., 3.]]
  base_size: 320
  steps: [16, 32, 64, 107, 160, 320]
  flip: true
  clip: true
  max_ratio: 95
  min_ratio: 20
  offset: 0.5
  conv_decay: 0.00004

LearningRate:
  base_lr: 0.00025
  schedulers:
  - !PiecewiseDecay
    gamma: 0.1
    milestones: [80000, 100000]
  - !LinearWarmup
    start_factor: 0.3333333333333333
    steps: 100

OptimizerBuilder:
  optimizer:
    momentum: 0.9
    type: Momentum
  regularizer:
    factor: 0.0005
    type: L2

TrainReader:
  inputs_def:
    image_shape: [3, 320, 320]
    fields: ['image', 'gt_bbox', 'gt_class']
  dataset:
    !VOCDataSet
    dataset_dir: dataset/voc
    anno_path: trainval.txt
  sample_transforms:
  - !DecodeImage
    to_rgb: true
  - !RandomDistort
    brightness_lower: 0.875
    brightness_upper: 1.125
    is_order: true
  - !RandomExpand
    fill_value: [123.675, 116.28, 103.53]
  - !RandomCrop
    allow_no_crop: false
  - !NormalizeBox {}
  - !ResizeImage
    interp: 1
    target_size: 320
    use_cv2: false
  - !RandomFlipImage
    is_normalized: false
  - !NormalizeImage
    mean: [0.485, 0.456, 0.406]
    std: [0.229, 0.224, 0.225]
    is_scale: true
    is_channel_first: false
  - !Permute
    to_bgr: false
    channel_first: true
  batch_size: 32
  shuffle: true
  drop_last: true
  # Number of working threads/processes. To speed up, can be set to 16 or 32 etc.
  worker_num: 0
  # Size of shared memory used in result queue. After increasing `worker_num`, need expand `memsize`.
  memsize: 0
  # Buffer size for multi threads/processes.one instance in buffer is one batch data.
  # To speed up, can be set to 64 or 128 etc.
  bufsize: 0
  use_process: true


EvalReader:
  inputs_def:
    image_shape: [3, 320, 320]
    fields: ['image', 'gt_bbox', 'gt_class', 'im_shape', 'im_id', 'is_difficult']
  dataset:
    !VOCDataSet
    dataset_dir: dataset/voc
    anno_path: test.txt
  sample_transforms:
  - !DecodeImage
    to_rgb: true
  - !NormalizeBox {}
  - !ResizeImage
    interp: 1
    target_size: 320
    use_cv2: false
  - !NormalizeImage
    mean: [0.485, 0.456, 0.406]
    std: [0.229, 0.224, 0.225]
    is_scale: true
    is_channel_first: false
  - !Permute
    to_bgr: false
    channel_first: True
  batch_size: 8
  worker_num: 0
  bufsize: 0
  use_process: false

TestReader:
  inputs_def:
    image_shape: [3,320,320]
    fields: ['image', 'im_id', 'im_shape', 'is_difficult']
  dataset:
    !ImageFolder
    anno_path: annotations/instances_val2017.json
  sample_transforms:
  - !DecodeImage
    to_rgb: true
  - !ResizeImage
    interp: 1
    max_size: 0
    target_size: 320
    use_cv2: true
  - !NormalizeImage
    mean: [0.485, 0.456, 0.406]
    std: [0.229, 0.224, 0.225]
    is_scale: true
    is_channel_first: false
  - !Permute
    to_bgr: false
    channel_first: True
  batch_size: 1

dengxinlong avatar Mar 12 '21 13:03 dengxinlong

其实我想知道的是,在windows中训练模型,1080Ti的显卡,1G的显存。 batch_size;worker_num;bufsize;memsize分别设置多少较为合适?

dengxinlong avatar Mar 12 '21 14:03 dengxinlong

更新问题,上面的问题是我加载预训练权重的时候路径不对,但是在预训练权重没有问题之后,出现了下面的问题,检测到显卡信息之后,就直接退出了。 BHCJ(9LZQB9M 9}JDC3TO~D

dengxinlong avatar Mar 12 '21 15:03 dengxinlong

可以发一下paddle的版本吗?

wangxinxin08 avatar Mar 13 '21 13:03 wangxinxin08

2.0.0

可以发一下paddle的版本吗?

2.0.0

dengxinlong avatar Mar 13 '21 14:03 dengxinlong

好的,我们之后在windows上定位下

wangxinxin08 avatar Mar 13 '21 14:03 wangxinxin08

其实我想知道的是,在windows中训练模型,1080Ti的显卡,1G的显存。 batch_size;worker_num;bufsize;memsize分别设置多少较为合适?

这里有一些参考:https://github.com/PaddlePaddle/PaddleDetection/blob/release/2.0-rc/docs/FAQ.md 建议都先设置为最小,然后从小往大试

liuhuiCNN avatar Mar 15 '21 03:03 liuhuiCNN