Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about SSD on VOC #38

Closed
ghost opened this issue Sep 7, 2021 · 7 comments
Closed

Question about SSD on VOC #38

ghost opened this issue Sep 7, 2021 · 7 comments
Labels
good first issue Good for newcomers

Comments

@ghost
Copy link

ghost commented Sep 7, 2021

Hello,

Thank you for sharing works!

I ran MIAOD_SSD.py config to reproduce the Figure 5(b) in the paper.
But, the number of labeled images increases by 2k (not 1k) each cycle.

@yuantn
Copy link
Owner

yuantn commented Sep 7, 2021

Hello,

Thanks for your attention to our work!

There seems to be no problems in the config. Could you provide your output log for examination?

@ghost
Copy link
Author

ghost commented Sep 7, 2021

2021-09-06 09:44:26,951 - mmdet - INFO - Environment info:

sys.platform: linux
Python: 3.6.12 (default, Aug 18 2020, 02:08:22) [GCC 5.4.0 20160609]
CUDA available: True
CUDA_HOME: /usr/local/cuda
NVCC: Cuda compilation tools, release 10.1, V10.1.243
GPU 0: Tesla P40
GCC: gcc (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609
PyTorch: 1.6.0
PyTorch compiling details: PyTorch built with:

  • GCC 7.3
  • C++ Version: 201402
  • Intel(R) Math Kernel Library Version 2019.0.5 Product Build 20190808 for Intel(R) 64 architecture applications
  • Intel(R) MKL-DNN v1.5.0 (Git Hash e2ac1fac44c5078ca927cb9b90e1b3066a0b2ed0)
  • OpenMP 201511 (a.k.a. OpenMP 4.5)
  • NNPACK is enabled
  • CPU capability usage: AVX2
  • CUDA Runtime 10.2
  • NVCC architecture flags: -gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75
  • CuDNN 7.6.5
  • Magma 2.5.2
  • Build settings: BLAS=MKL, BUILD_TYPE=Release, CXX_FLAGS= -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DUSE_VULKAN_WRAPPER -O2 -fPIC -Wno-narrowing -Wall -Wextra -Wer$

TorchVision: 0.7.0
OpenCV: 4.5.3
MMCV: 1.0.5
MMDetection: 2.3.0+e343491
MMDetection Compiler: GCC 5.4
MMDetection CUDA Compiler: 10.1

2021-09-06 09:44:26,952 - mmdet - INFO - Distributed training: False
2021-09-06 09:44:27,630 - mmdet - INFO - Config:
input_size = 300
model = dict(
type='SingleStageDetector',
pretrained='open-mmlab://vgg16_caffe',
backbone=dict(
type='SSDVGG',
input_size=300,
depth=16,
with_last_pool=False,
ceil_mode=True,
out_indices=(3, 4),
out_feature_indices=(22, 34),
l2_norm_scale=20),
neck=None,
bbox_head=dict(
type='SSDHead',
in_channels=(512, 1024, 512, 256, 256, 256),
C=20,
anchor_generator=dict(
type='SSDAnchorGenerator',
scale_major=False,
input_size=300,
basesize_ratio_range=(0.2, 0.9),
strides=[8, 16, 32, 64, 100, 300],
ratios=[[2], [2, 3], [2, 3], [2, 3], [2], [2]]),
bbox_coder=dict(
type='DeltaXYWHBBoxCoder',
target_means=[0.0, 0.0, 0.0, 0.0],
target_stds=[0.1, 0.1, 0.2, 0.2])))
cudnn_benchmark = True
train_cfg = dict(
assigner=dict(
type='MaxIoUAssigner',
pos_iou_thr=0.5,
neg_iou_thr=0.5,
min_pos_iou=0.0,
ignore_iof_thr=-1,
gt_max_assign_all=False),
smoothl1_beta=1.0,
allowed_border=-1,
pos_weight=-1,
neg_pos_ratio=3,
debug=False,
param_lambda=0.5)
test_cfg = dict(
nms=dict(type='nms', iou_threshold=0.45),
min_bbox_size=0,
score_thr=0.02,
max_per_img=200)
theta_f_1 = [
'bbox_head.f_1_convs.0.weight', 'bbox_head.f_1_convs.0.bias',
'bbox_head.f_1_convs.1.weight', 'bbox_head.f_1_convs.1.bias',
'bbox_head.f_1_convs.2.weight', 'bbox_head.f_1_convs.2.bias',
'bbox_head.f_1_convs.3.weight', 'bbox_head.f_1_convs.3.bias',
'bbox_head.f_1_convs.4.weight', 'bbox_head.f_1_convs.4.bias',
'bbox_head.f_1_convs.5.weight', 'bbox_head.f_1_convs.5.bias'
]
theta_f_2 = [
'bbox_head.f_2_convs.0.weight', 'bbox_head.f_2_convs.0.bias',
'bbox_head.f_2_convs.1.weight', 'bbox_head.f_2_convs.1.bias',
'bbox_head.f_2_convs.2.weight', 'bbox_head.f_2_convs.2.bias',
'bbox_head.f_2_convs.3.weight', 'bbox_head.f_2_convs.3.bias',
'bbox_head.f_2_convs.4.weight', 'bbox_head.f_2_convs.4.bias',
'bbox_head.f_2_convs.5.weight', 'bbox_head.f_2_convs.5.bias'
]
data_root = '/muzi/data/al/od/VOCdevkit/'
dataset_type = 'VOCDataset'
img_norm_cfg = dict(mean=[123.675, 116.28, 103.53], std=[1, 1, 1], to_rgb=True)
train_pipeline = [
dict(type='LoadImageFromFile', to_float32=True),
dict(type='LoadAnnotations', with_bbox=True),
dict(
type='PhotoMetricDistortion',
brightness_delta=32,
contrast_range=(0.5, 1.5),
saturation_range=(0.5, 1.5),
hue_delta=18),
dict(
type='Expand',
mean=[123.675, 116.28, 103.53],
to_rgb=True,
ratio_range=(1, 4)),
dict(
type='MinIoURandomCrop',
min_ious=(0.1, 0.3, 0.5, 0.7, 0.9),
min_crop_size=0.3),
dict(type='Resize', img_scale=(300, 300), keep_ratio=False),
dict(
type='Normalize',
mean=[123.675, 116.28, 103.53],
std=[1, 1, 1],
to_rgb=True),
dict(type='RandomFlip', flip_ratio=0.5),
dict(type='DefaultFormatBundle'),
dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels'])
]
test_pipeline = [
dict(type='LoadImageFromFile'),
dict(
type='MultiScaleFlipAug',
img_scale=(300, 300),
flip=False,
transforms=[
dict(type='Resize', keep_ratio=False),
dict(
type='Normalize',
mean=[123.675, 116.28, 103.53],
std=[1, 1, 1],
to_rgb=True),
dict(type='ImageToTensor', keys=['img']),
dict(type='Collect', keys=['img'])
])
]
data = dict(
samples_per_gpu=8,
workers_per_gpu=3,
train=dict(
type='RepeatDataset',
times=1,
dataset=dict(
type='VOCDataset',
ann_file=[
'/muzi/data/al/od/VOCdevkit/VOC2007/ImageSets/Main/trainval.txt',
'/muzi/data/al/od/VOCdevkit/VOC2012/ImageSets/Main/trainval.txt'
],
img_prefix=[
'/muzi/data/al/od/VOCdevkit/VOC2007/',
'/muzi/data/al/od/VOCdevkit/VOC2012/'
],
pipeline=[
dict(type='LoadImageFromFile', to_float32=True),
dict(type='LoadAnnotations', with_bbox=True),
dict(
type='PhotoMetricDistortion',
brightness_delta=32,
contrast_range=(0.5, 1.5),
saturation_range=(0.5, 1.5),
hue_delta=18),
dict(
type='Expand',
mean=[123.675, 116.28, 103.53],
to_rgb=True,
ratio_range=(1, 4)),
dict(
type='MinIoURandomCrop',
min_ious=(0.1, 0.3, 0.5, 0.7, 0.9),
min_crop_size=0.3),
dict(type='Resize', img_scale=(300, 300), keep_ratio=False),
dict(
type='Normalize',
mean=[123.675, 116.28, 103.53],
std=[1, 1, 1],
to_rgb=True),
dict(type='RandomFlip', flip_ratio=0.5),
dict(type='DefaultFormatBundle'),
dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels'])
])),
val=dict(
type='VOCDataset',
ann_file='/muzi/data/al/od/VOCdevkit/VOC2007/ImageSets/Main/test.txt',
img_prefix='/muzi/data/al/od/VOCdevkit/VOC2007/',
pipeline=[
dict(type='LoadImageFromFile'),
dict(
type='MultiScaleFlipAug',
img_scale=(300, 300),
flip=False,
transforms=[
dict(type='Resize', keep_ratio=False),
dict(
type='Normalize',
mean=[123.675, 116.28, 103.53],
std=[1, 1, 1],
to_rgb=True),
dict(type='ImageToTensor', keys=['img']),
dict(type='Collect', keys=['img'])
])
]),
test=dict(
type='VOCDataset',
ann_file=[
'/muzi/data/al/od/VOCdevkit/VOC2007/ImageSets/Main/trainval.txt',
'/muzi/data/al/od/VOCdevkit/VOC2012/ImageSets/Main/trainval.txt'
],
img_prefix=[
'/muzi/data/al/od/VOCdevkit/VOC2007/',
'/muzi/data/al/od/VOCdevkit/VOC2012/'
],
pipeline=[
dict(type='LoadImageFromFile'),
dict(
type='MultiScaleFlipAug',
img_scale=(300, 300),
flip=False,
transforms=[
dict(type='Resize', keep_ratio=False),
dict(
type='Normalize',
mean=[123.675, 116.28, 103.53],
std=[1, 1, 1],
to_rgb=True),
dict(type='ImageToTensor', keys=['img']),
dict(type='Collect', keys=['img'])
])
]))
evaluation = dict(interval=5, metric='mAP')
checkpoint_config = dict(interval=1)
log_config = dict(interval=50, hooks=[dict(type='TextLoggerHook')])
dist_params = dict(backend='nccl')
log_level = 'INFO'
load_from = None
resume_from = None
workflow = [('train', 1)]
optimizer = dict(type='SGD', lr=0.001, momentum=0.9, weight_decay=0.0005)
optimizer_config = dict()
lr_config = dict(
policy='step',
warmup='linear',
warmup_iters=500,
warmup_ratio=0.001,
step=[1])
epoch_ratio = [5, 1]
epoch = 2
X_L_repeat = 16
X_U_repeat = 16
k = 10000
X_S_size = 1000
X_L_0_size = 1000
cycles = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
work_directory = '/muzi/logs/al/od/miaod/voc_ssd/trial_0'
gpu_ids = range(0, 1)

2021-09-06 09:44:27,631 - mmdet - INFO - Set random seed to 666, deterministic: False
2021-09-06 09:44:27,715 - mmdet - INFO - Set random seed to 666, deterministic: False
2021-09-06 09:44:28,085 - mmdet - INFO - load model from: open-mmlab://vgg16_caffe
2021-09-06 09:44:28,161 - mmdet - WARNING - The model and loaded state dict do not match exactly

missing keys in source state_dict: extra.0.weight, extra.0.bias, extra.1.weight, extra.1.bias, extra.2.weight, extra.2.bias, extra.3.weight, extra.3.bias, extra.4.weight, extra.4.bias, extra.5.weight, extra.5.bias, extra.6.weight, extra.6.bias, extra.7.weight, extra.7$

2021-09-06 09:44:37,441 - mmdet - INFO - Start running, host: svcapp@workspace-899, work_directory: /muzi/logs/al/od/miaod/voc_ssd/trial_0/20210906_094426
2021-09-06 09:44:37,442 - mmdet - INFO - workflow: [('train', 1)], max: 5 epochs
2021-09-06 09:45:01,958 - mmdet - INFO - Epoch [1][50/2000] lr: 9.890e-05, eta: 1:20:52, time: 0.488, data_time: 0.056, memory: 10018, l_det_cls: 17.9104, l_det_loc: 3.0110, l_imgcls: 0.2427, L_det: 21.1641
2021-09-06 09:45:20,605 - mmdet - INFO - Epoch [1][100/2000] lr: 1.988e-04, eta: 1:10:59, time: 0.373, data_time: 0.012, memory: 10018, l_det_cls: 12.3032, l_det_loc: 2.7717, l_imgcls: 0.2481, L_det: 15.3230
2021-09-06 09:45:39,274 - mmdet - INFO - Epoch [1][150/2000] lr: 2.987e-04, eta: 1:07:31, time: 0.373, data_time: 0.012, memory: 10018, l_det_cls: 10.8066, l_det_loc: 2.8618, l_imgcls: 0.2456, L_det: 13.9141
2021-09-06 09:45:58,018 - mmdet - INFO - Epoch [1][200/2000] lr: 3.986e-04, eta: 1:05:41, time: 0.375, data_time: 0.012, memory: 10018, l_det_cls: 6.7048, l_det_loc: 2.7885, l_imgcls: 0.2420, L_det: 9.7354
2021-09-06 09:46:16,628 - mmdet - INFO - Epoch [1][250/2000] lr: 4.985e-04, eta: 1:04:22, time: 0.372, data_time: 0.012, memory: 10018, l_det_cls: 5.6036, l_det_loc: 2.6494, l_imgcls: 0.2207, L_det: 8.4737
2021-09-06 09:46:35,303 - mmdet - INFO - Epoch [1][300/2000] lr: 5.984e-04, eta: 1:03:26, time: 0.373, data_time: 0.012, memory: 10018, l_det_cls: 5.1834, l_det_loc: 2.6133, l_imgcls: 0.2228, L_det: 8.0195
2021-09-06 09:46:54,704 - mmdet - INFO - Epoch [1][350/2000] lr: 6.983e-04, eta: 1:03:00, time: 0.388, data_time: 0.012, memory: 10018, l_det_cls: 5.3418, l_det_loc: 2.6069, l_imgcls: 0.2182, L_det: 8.1669
2021-09-06 09:47:13,962 - mmdet - INFO - Epoch [1][400/2000] lr: 7.982e-04, eta: 1:02:33, time: 0.385, data_time: 0.012, memory: 10018, l_det_cls: 5.2064, l_det_loc: 2.4717, l_imgcls: 0.2175, L_det: 7.8956
2021-09-06 09:47:32,623 - mmdet - INFO - Epoch [1][450/2000] lr: 8.981e-04, eta: 1:01:54, time: 0.373, data_time: 0.012, memory: 10018, l_det_cls: 5.0469, l_det_loc: 2.4876, l_imgcls: 0.2173, L_det: 7.7519
2021-09-06 09:47:51,335 - mmdet - INFO - Epoch [1][500/2000] lr: 9.980e-04, eta: 1:01:21, time: 0.374, data_time: 0.012, memory: 10018, l_det_cls: 5.0143, l_det_loc: 2.3822, l_imgcls: 0.2201, L_det: 7.6166
2021-09-06 09:48:10,087 - mmdet - INFO - Epoch [1][550/2000] lr: 1.000e-03, eta: 1:00:51, time: 0.375, data_time: 0.012, memory: 10018, l_det_cls: 5.1041, l_det_loc: 2.3307, l_imgcls: 0.2302, L_det: 7.6649
2021-09-06 09:48:28,805 - mmdet - INFO - Epoch [1][600/2000] lr: 1.000e-03, eta: 1:00:22, time: 0.374, data_time: 0.012, memory: 10018, l_det_cls: 5.1053, l_det_loc: 2.2741, l_imgcls: 0.2200, L_det: 7.5993
2021-09-06 09:48:47,365 - mmdet - INFO - Epoch [1][650/2000] lr: 1.000e-03, eta: 0:59:53, time: 0.371, data_time: 0.012, memory: 10018, l_det_cls: 5.0543, l_det_loc: 2.2532, l_imgcls: 0.2153, L_det: 7.5227
2021-09-06 09:49:05,948 - mmdet - INFO - Epoch [1][700/2000] lr: 1.000e-03, eta: 0:59:25, time: 0.372, data_time: 0.012, memory: 10018, l_det_cls: 5.0043, l_det_loc: 2.2249, l_imgcls: 0.2247, L_det: 7.4539
2021-09-06 09:49:24,792 - mmdet - INFO - Epoch [1][750/2000] lr: 1.000e-03, eta: 0:59:02, time: 0.377, data_time: 0.012, memory: 10018, l_det_cls: 4.8676, l_det_loc: 2.1896, l_imgcls: 0.2192, L_det: 7.2765
2021-09-06 09:49:43,671 - mmdet - INFO - Epoch [1][800/2000] lr: 1.000e-03, eta: 0:58:40, time: 0.378, data_time: 0.012, memory: 10018, l_det_cls: 4.9734, l_det_loc: 2.1614, l_imgcls: 0.2261, L_det: 7.3610
2021-09-06 09:50:02,444 - mmdet - INFO - Epoch [1][850/2000] lr: 1.000e-03, eta: 0:58:17, time: 0.375, data_time: 0.013, memory: 10018, l_det_cls: 4.9286, l_det_loc: 2.1764, l_imgcls: 0.2267, L_det: 7.3317
2021-09-06 09:50:21,276 - mmdet - INFO - Epoch [1][900/2000] lr: 1.000e-03, eta: 0:57:55, time: 0.377, data_time: 0.012, memory: 10018, l_det_cls: 4.9132, l_det_loc: 2.1281, l_imgcls: 0.2172, L_det: 7.2585
2021-09-06 09:50:39,892 - mmdet - INFO - Epoch [1][950/2000] lr: 1.000e-03, eta: 0:57:31, time: 0.372, data_time: 0.012, memory: 10018, l_det_cls: 4.9181, l_det_loc: 2.2532, l_imgcls: 0.2215, L_det: 7.3928
2021-09-06 09:50:58,791 - mmdet - INFO - Epoch [1][1000/2000] lr: 1.000e-03, eta: 0:57:10, time: 0.378, data_time: 0.012, memory: 10018, l_det_cls: 4.8111, l_det_loc: 2.1222, l_imgcls: 0.2216, L_det: 7.1549

@yuantn
Copy link
Owner

yuantn commented Sep 7, 2021

Thanks, it seems normal.

And how do you know that the number of labeled images increases by 2k but not 1k each cycle?

Could you provide the shape of X_L_0.npy and X_L_1.npy in /muzi/logs/al/od/miaod/voc_ssd/trial_0/$TIMESTAMP/ (where the $TIMESTAMP is like 20210907_203401) ?

@ghost
Copy link
Author

ghost commented Sep 8, 2021

Sorry, I misunderstood that maximum iterations is the number of labeled images in training logs, e.g.
2021-09-06 09:45:01,958 - mmdet - INFO - Epoch [1][50/2000] lr: 9.890e-05, eta: 1:20:52, time: 0.488, data_time: 0.056, memory: 10018, l_det_cls: 17.9104, l_det_loc: 3.0110, l_imgcls: 0.2427, L_det: 21.1641
2000 is calculated by X_L_0_size * X_L_repeat / samples_per_gpu = 1000 * 16 / 8 according to MIAOD_SSD.py, right?

I checked the shape of X_L_0.npy and X_L_1.npy is (1000,) and (2000,).
Thank you very much!

@yuantn
Copy link
Owner

yuantn commented Sep 8, 2021

Yes, that's it.

@ghost ghost closed this as completed Sep 8, 2021
@yuantn yuantn added the good first issue Good for newcomers label Sep 8, 2021
@Liang-ZX
Copy link

Liang-ZX commented Oct 5, 2021

Sorry, I misunderstood that maximum iterations is the number of labeled images in training logs, e.g. 2021-09-06 09:45:01,958 - mmdet - INFO - Epoch [1][50/2000] lr: 9.890e-05, eta: 1:20:52, time: 0.488, data_time: 0.056, memory: 10018, l_det_cls: 17.9104, l_det_loc: 3.0110, l_imgcls: 0.2427, L_det: 21.1641 2000 is calculated by X_L_0_size * X_L_repeat / samples_per_gpu = 1000 * 16 / 8 according to MIAOD_SSD.py, right?

I checked the shape of X_L_0.npy and X_L_1.npy is (1000,) and (2000,). Thank you very much!

Excuse me. I would like to know whether your running result of SSD comparable to that in the paper. If so, how do you modify the code? Only the config file? Thanks.

yuantn added a commit that referenced this issue Oct 18, 2021
@jiahao12121
Copy link

Sorry, I misunderstood that maximum iterations is the number of labeled images in training logs, e.g. 2021-09-06 09:45:01,958 - mmdet - INFO - Epoch [1][50/2000] lr: 9.890e-05, eta: 1:20:52, time: 0.488, data_time: 0.056, memory: 10018, l_det_cls: 17.9104, l_det_loc: 3.0110, l_imgcls: 0.2427, L_det: 21.1641 2000 is calculated by X_L_0_size * X_L_repeat / samples_per_gpu = 1000 * 16 / 8 according to MIAOD_SSD.py, right?
I checked the shape of X_L_0.npy and X_L_1.npy is (1000,) and (2000,). Thank you very much!

Excuse me. I would like to know whether your running result of SSD comparable to that in the paper. If so, how do you modify the code? Only the config file? Thanks.

i meet the same question, and the parameters of my log file is same to the author'. Would you find the reason?

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants