Help required YOLOX training #9714
Unanswered
saadyousuf45
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Config:
optimizer = dict(
type='SGD',
lr=0.01,
momentum=0.9,
weight_decay=0.0005,
nesterov=True,
paramwise_cfg=dict(norm_decay_mult=0.0, bias_decay_mult=0.0))
optimizer_config = dict(grad_clip=None)
lr_config = dict(
policy='YOLOX',
warmup='exp',
by_epoch=False,
warmup_by_epoch=True,
warmup_ratio=1,
warmup_iters=5,
num_last_epochs=15,
min_lr_ratio=0.05)
runner = dict(type='EpochBasedRunner', max_epochs=300)
checkpoint_config = dict(interval=10)
log_config = dict(
interval=50,
hooks=[dict(type='TextLoggerHook'),
dict(type='TensorboardLoggerHook')])
custom_hooks = [
dict(type='YOLOXModeSwitchHook', num_last_epochs=15, priority=48),
dict(type='SyncNormHook', num_last_epochs=15, interval=10, priority=48),
dict(
type='ExpMomentumEMAHook',
resume_from=None,
momentum=0.0001,
priority=49)
]
dist_params = dict(backend='nccl')
log_level = 'INFO'
load_from = '/content/drive/MyDrive/Colab Notebooks/Rad_files/Pre-trained Model Checkpoint/yolox_x_8x8_300e_coco.py'
resume_from = None
workflow = [('train', 1)]
opencv_num_threads = 0
mp_start_method = 'fork'
auto_scale_lr = dict(enable=False, base_batch_size=64)
img_scale = (640, 640)
model = dict(
type='YOLOX',
input_size=(640, 640),
random_size_range=(15, 25),
random_size_interval=10,
backbone=dict(type='CSPDarknet', deepen_factor=1.33, widen_factor=1.25),
neck=dict(
type='YOLOXPAFPN',
in_channels=[320, 640, 1280],
out_channels=320,
num_csp_blocks=4),
bbox_head=dict(
type='YOLOXHead', num_classes=162, in_channels=320, feat_channels=320),
train_cfg=dict(assigner=dict(type='SimOTAAssigner', center_radius=2.5)),
test_cfg=dict(score_thr=0.01, nms=dict(type='nms', iou_threshold=0.65)))
data_root = 'data/'
dataset_type = 'NewDataset'
train_pipeline = [
dict(type='Mosaic', img_scale=(640, 640), pad_val=114.0),
dict(
type='RandomAffine', scaling_ratio_range=(0.1, 2),
border=(-320, -320)),
dict(
type='MixUp',
img_scale=(640, 640),
ratio_range=(0.8, 1.6),
pad_val=114.0),
dict(type='YOLOXHSVRandomAug'),
dict(type='RandomFlip', flip_ratio=0.5),
dict(type='Resize', img_scale=(640, 640), keep_ratio=True),
dict(
type='Pad',
pad_to_square=True,
pad_val=dict(img=(114.0, 114.0, 114.0))),
dict(type='FilterAnnotations', min_gt_bbox_wh=(1, 1), keep_empty=False),
dict(type='DefaultFormatBundle'),
dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels'])
]
train_dataset = dict(
type='MultiImageMixDataset',
dataset=dict(
type='CocoDataset',
ann_file='data/coco/annotations/instances_train2017.json',
img_prefix='data/coco/train2017/',
pipeline=[
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations', with_bbox=True)
],
filter_empty_gt=False),
pipeline=[
dict(type='Mosaic', img_scale=(640, 640), pad_val=114.0),
dict(
type='RandomAffine',
scaling_ratio_range=(0.1, 2),
border=(-320, -320)),
dict(
type='MixUp',
img_scale=(640, 640),
ratio_range=(0.8, 1.6),
pad_val=114.0),
dict(type='YOLOXHSVRandomAug'),
dict(type='RandomFlip', flip_ratio=0.5),
dict(type='Resize', img_scale=(640, 640), keep_ratio=True),
dict(
type='Pad',
pad_to_square=True,
pad_val=dict(img=(114.0, 114.0, 114.0))),
dict(
type='FilterAnnotations', min_gt_bbox_wh=(1, 1), keep_empty=False),
dict(type='DefaultFormatBundle'),
dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels'])
])
test_pipeline = [
dict(type='LoadImageFromFile'),
dict(
type='MultiScaleFlipAug',
img_scale=(640, 640),
flip=False,
transforms=[
dict(type='Resize', keep_ratio=True),
dict(type='RandomFlip'),
dict(
type='Pad',
pad_to_square=True,
pad_val=dict(img=(114.0, 114.0, 114.0))),
dict(type='DefaultFormatBundle'),
dict(type='Collect', keys=['img'])
])
]
data = dict(
samples_per_gpu=8,
workers_per_gpu=4,
persistent_workers=True,
train=dict(
type='RepeatDataset',
dataset=dict(
type='NewDataset',
ann_file='/content/mmdetection/data/train.txt',
img_prefix=
'/content/drive/MyDrive/Colab Notebooks/Rad_files/Final_testing_images/',
pipeline=[
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations', with_bbox=True)
],
filter_empty_gt=False,
data_root='data/'),
pipeline=[
dict(type='Mosaic', img_scale=(640, 640), pad_val=114.0),
dict(
type='RandomAffine',
scaling_ratio_range=(0.1, 2),
border=(-320, -320)),
dict(
type='MixUp',
img_scale=(640, 640),
ratio_range=(0.8, 1.6),
pad_val=114.0),
dict(type='YOLOXHSVRandomAug'),
dict(type='RandomFlip', flip_ratio=0.5),
dict(type='Resize', img_scale=(640, 640), keep_ratio=True),
dict(
type='Pad',
pad_to_square=True,
pad_val=dict(img=(114.0, 114.0, 114.0))),
dict(
type='FilterAnnotations',
min_gt_bbox_wh=(1, 1),
keep_empty=False),
dict(type='DefaultFormatBundle'),
dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels'])
]),
val=dict(
type='NewDataset',
ann_file='test.txt',
img_prefix=
'/content/drive/MyDrive/Colab Notebooks/Rad_files/Final_testing_images/',
pipeline=[
dict(type='LoadImageFromFile'),
dict(
type='MultiScaleFlipAug',
img_scale=(640, 640),
flip=False,
transforms=[
dict(type='Resize', keep_ratio=True),
dict(type='RandomFlip'),
dict(
type='Pad',
pad_to_square=True,
pad_val=dict(img=(114.0, 114.0, 114.0))),
dict(type='DefaultFormatBundle'),
dict(type='Collect', keys=['img'])
])
],
data_root='data/'),
test=dict(
type='NewDataset',
ann_file='train.txt',
img_prefix=
'/content/drive/MyDrive/Colab Notebooks/Rad_files/Final_testing_images/',
pipeline=[
dict(type='LoadImageFromFile'),
dict(
type='MultiScaleFlipAug',
img_scale=(640, 640),
flip=False,
transforms=[
dict(type='Resize', keep_ratio=True),
dict(type='RandomFlip'),
dict(
type='Pad',
pad_to_square=True,
pad_val=dict(img=(114.0, 114.0, 114.0))),
dict(type='DefaultFormatBundle'),
dict(type='Collect', keys=['img'])
])
],
data_root='data/'))
max_epochs = 300
num_last_epochs = 15
interval = 10
evaluation = dict(
save_best='auto', interval=10, dynamic_intervals=[(285, 1)], metric='mAP')
work_dir = '/content/drive/MyDrive/Colab Notebooks/Final thesis implementation/testing for HPC/'
seed = 0
gpu_ids = range(0, 1)
The error i get:
:80: DeprecationWarning:
np.long
is a deprecated alias fornp.compat.long
. To silence this warning, usenp.compat.long
by itself. In the likely event your code does not need to work on Python 2 you can use the builtinint
for whichnp.compat.long
is itself an alias. Doing this will not modify any behaviour and is safe. When replacingnp.long
, you may wish to use e.g.np.int64
ornp.int32
to specify the precision. If you wish to review your current use, check the release note link for additional information.Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
labels = np.array(gt_labels, dtype = np.long),
:82: DeprecationWarning:
np.long
is a deprecated alias fornp.compat.long
. To silence this warning, usenp.compat.long
by itself. In the likely event your code does not need to work on Python 2 you can use the builtinint
for whichnp.compat.long
is itself an alias. Doing this will not modify any behaviour and is safe. When replacingnp.long
, you may wish to use e.g.np.int64
ornp.int32
to specify the precision. If you wish to review your current use, check the release note link for additional information.Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
labels_ignore = np.array(gt_labels_ignore, dtype = np.long))
KeyError Traceback (most recent call last)
in
5
6
----> 7 datasets = [build_dataset(cfg.data.train)]
8
9 model = build_detector(
1 frames
/usr/local/lib/python3.8/dist-packages/mmcv/utils/config.py in missing(self, name)
36
37 def missing(self, name):
---> 38 raise KeyError(name)
39
40 def getattr(self, name):
KeyError: 'times'
Beta Was this translation helpful? Give feedback.
All reactions