-
Notifications
You must be signed in to change notification settings - Fork 13
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
I got an strange result from the training with HR dataset #7
Comments
@MengyuWang826 checkpoint_config = dict(
interval=5000, by_epoch=False, save_last=True, max_keep_ckpts=20)
log_config = dict(
interval=50, hooks=[dict(type='TextLoggerHook', by_epoch=False)])
dist_params = dict(backend='nccl')
log_level = 'INFO'
load_from = None
resume_from = 'segrefiner_hr_latest.pth'
workflow = [('train', 5000)]
opencv_num_threads = 0
mp_start_method = 'fork'
auto_scale_lr = dict(enable=False, base_batch_size=16)
object_size = 256
task = 'instance'
model = dict(
type='SegRefiner',
task='instance',
step=6,
denoise_model=dict(
type='DenoiseUNet',
in_channels=4,
out_channels=1,
model_channels=128,
num_res_blocks=2,
num_heads=4,
num_heads_upsample=-1,
attention_strides=(16, 32),
learn_time_embd=True,
channel_mult=(1, 1, 2, 2, 4, 4),
dropout=0.0),
diffusion_cfg=dict(
betas=dict(type='linear', start=0.8, stop=0, num_timesteps=6),
diff_iter=False),
test_cfg=dict())
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(
type='LoadAnnotations',
with_bbox=False,
with_label=False,
with_mask=True),
dict(type='LoadPatchData', object_size=256, patch_size=256),
dict(type='Resize', img_scale=(256, 256), keep_ratio=False),
dict(type='RandomFlip', flip_ratio=0.5),
dict(
type='Normalize',
mean=[123.675, 116.28, 103.53],
std=[58.395, 57.12, 57.375],
to_rgb=True),
dict(type='DefaultFormatBundle'),
dict(
type='Collect',
keys=[
'object_img', 'object_gt_masks', 'object_coarse_masks',
'patch_img', 'patch_gt_masks', 'patch_coarse_masks'
])
]
dataset_type = 'HRCollectionDataset'
img_root = '/share/project/datasets/MSCOCO/coco2017/'
ann_root = '/share/project/datasets/LVIS/'
train_dataloader = dict(samples_per_gpu=4, workers_per_gpu=1)
data = dict(
train=dict(
type='HRCollectionDataset',
pipeline=[
dict(type='LoadImageFromFile'),
dict(
type='LoadAnnotations',
with_bbox=False,
with_label=False,
with_mask=True),
dict(type='LoadPatchData', object_size=256, patch_size=256),
dict(type='Resize', img_scale=(256, 256), keep_ratio=False),
dict(type='RandomFlip', flip_ratio=0.5),
dict(
type='Normalize',
mean=[123.675, 116.28, 103.53],
std=[58.395, 57.12, 57.375],
to_rgb=True),
dict(type='DefaultFormatBundle'),
dict(
type='Collect',
keys=[
'object_img', 'object_gt_masks', 'object_coarse_masks',
'patch_img', 'patch_gt_masks', 'patch_coarse_masks'
])
],
data_root='data/',
collection_datasets=['thin', 'dis'],
collection_json='data/collection_hr.json'),
train_dataloader=dict(samples_per_gpu=4, workers_per_gpu=1),
val=dict(),
test=dict())
optimizer = dict(
type='AdamW', lr=0.00004, weight_decay=0, eps=1e-08, betas=(0.9, 0.999))
optimizer_config = dict(grad_clip=None)
max_iters = 120000
runner = dict(type='IterBasedRunner', max_iters=120000)
lr_config = dict(
policy='step',
gamma=0.5,
by_epoch=False,
step=[80000, 100000],
warmup='linear',
warmup_by_epoch=False,
warmup_ratio=1.0,
warmup_iters=10)
interval = 5000
data_root = 'data/'
work_dir = './work_dirs/segrefiner_hr'
auto_resume = False
gpu_ids = [0] |
@yusuke-ai |
Alternatively, you can also try implementing a different method for collecting local patches, such as along the edges of the mask. The specific implementation of this step only affects which local patches will be refined and does not impact the functioning of the model. |
@MengyuWang826 |
Since not all positions exhibit jaggy segmentation, I speculate that the areas within the red box represent the normal output, and the appearance of jaggy segmentation is due to not being subjected to local refinement. You can start by visualizing to determine which local patches have undergone local refinement. |
@MengyuWang826 |
@yusuke-ai |
@wzx0720 |
Sorry for bothering you again. I can't understand how to edit the lines. Do you mean to edit the |
same problem, have you solved it? |
@wang21jun I haven't try but maybe you could modify the |
Thinks, I will try it. |
|
Yes, I had the same problem in my work so I quit this method now. Maybe you can open an issue and ask the author, I think. |
Hi,
Thank you for the awesome work!
I trained the model with the HR dataset with the almost same configuration as your code and with the command below. The only difference is the learning rate and it is set to 4e-5 and got models both in iteration=10000 and iteration=around 60000.
(I didn't use the same training rate with the your code because it sometimes jumps the loss while training. I will comment more in #4)
and I got the different refinement results. The original segrefiner_hr_latest.pth model has a smooth segmentation around the line, but the retrained model has a jaggy segmentation around the line like below.
Expected result is the model shouldn't output differently.
Could you help me with finding the core issue?
Thank you!
Segmentation result with the segrefiner_hr_latest.pth
Segmentation result with the retrained model
The text was updated successfully, but these errors were encountered: