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

train with 1 gpu #156

Open
ahmedzioudi opened this issue Jul 6, 2023 · 1 comment
Open

train with 1 gpu #156

ahmedzioudi opened this issue Jul 6, 2023 · 1 comment

Comments

@ahmedzioudi
Copy link

ahmedzioudi commented Jul 6, 2023

No description provided.

@ahmedzioudi
Copy link
Author

2023-07-06 23:45:29,047 - davarocr - INFO - Environment info:

sys.platform: linux
Python: 3.8.10 (default, May 26 2023, 14:05:08) [GCC 9.4.0]
CUDA available: True
GPU 0: NVIDIA GeForce GTX 1650 Ti
CUDA_HOME: /usr/local/cuda
NVCC: Build cuda_11.6.r11.6/compiler.31057947_0
GCC: gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
PyTorch: 1.7.1
PyTorch compiling details: PyTorch built with:

  • GCC 7.3
  • C++ Version: 201402
  • Intel(R) Math Kernel Library Version 2020.0.0 Product Build 20191122 for Intel(R) 64 architecture applications
  • Intel(R) MKL-DNN v1.6.0 (Git Hash 5ef631a030a6f73131c77892041042805a06064f)
  • 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 -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-result -Wno-unused-local-typedefs -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-psabi -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Wno-stringop-overflow, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, USE_CUDA=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON,

TorchVision: 0.8.2
OpenCV: 4.7.0
MMCV: 1.3.4
MMCV Compiler: GCC 9.4
MMCV CUDA Compiler: 11.6
DAVAROCR: 0.6.0+49614e4

2023-07-06 23:45:29,943 - davarocr - INFO - Distributed training: False
2023-07-06 23:45:30,754 - davarocr - INFO - Config:
model = dict(
type='LGPMA',
pretrained=
'/home/zioudiahmed/Desktop/projet/DAVAR-Lab-OCR/resnet50-19c8e357.pth',
backbone=dict(
type='ResNet',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
style='pytorch'),
neck=dict(
type='FPN',
in_channels=[256, 512, 1024, 2048],
out_channels=256,
num_outs=5),
rpn_head=dict(
type='RPNHead',
in_channels=256,
feat_channels=256,
anchor_generator=dict(
type='AnchorGenerator',
scales=[4, 8, 16],
ratios=[0.05, 0.1, 0.2, 0.5, 1.0, 2.0],
strides=[4, 8, 16, 32, 64]),
bbox_coder=dict(
type='DeltaXYWHBBoxCoder',
target_means=[0.0, 0.0, 0.0, 0.0],
target_stds=[1.0, 1.0, 1.0, 1.0]),
loss_cls=dict(
type='CrossEntropyLoss', use_sigmoid=True, loss_weight=1.0),
loss_bbox=dict(
type='SmoothL1Loss', beta=0.1111111111111111, loss_weight=1.0)),
roi_head=dict(
type='LGPMARoIHead',
bbox_roi_extractor=dict(
type='SingleRoIExtractor',
roi_layer=dict(type='RoIAlign', output_size=7, sampling_ratio=0),
out_channels=256,
featmap_strides=[4, 8, 16, 32]),
bbox_head=dict(
type='Shared2FCBBoxHead',
in_channels=256,
fc_out_channels=1024,
roi_feat_size=7,
num_classes=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]),
reg_class_agnostic=False,
loss_cls=dict(
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0),
loss_bbox=dict(type='SmoothL1Loss', beta=1.0, loss_weight=1.0)),
mask_roi_extractor=dict(
type='SingleRoIExtractor',
roi_layer=dict(type='RoIAlign', output_size=14, sampling_ratio=0),
out_channels=256,
featmap_strides=[4, 8, 16, 32]),
mask_head=dict(
type='LPMAMaskHead',
num_convs=4,
in_channels=256,
conv_out_channels=256,
num_classes=2,
loss_mask=dict(
type='CrossEntropyLoss', use_mask=True, loss_weight=1.0),
loss_lpma=dict(type='L1Loss', loss_weight=1.0))),
global_seg_head=dict(
type='GPMAMaskHead',
in_channels=256,
conv_out_channels=256,
num_classes=1,
loss_mask=dict(type='DiceLoss', loss_weight=1),
loss_reg=dict(
type='SmoothL1Loss', beta=0.1, loss_weight=0.01, reduction='sum')),
train_cfg=dict(
rpn=dict(
assigner=dict(
type='MaxIoUAssigner',
pos_iou_thr=0.7,
neg_iou_thr=0.3,
min_pos_iou=0.3,
match_low_quality=True,
ignore_iof_thr=-1),
sampler=dict(
type='RandomSampler',
num=256,
pos_fraction=0.5,
neg_pos_ub=-1,
add_gt_as_proposals=False),
allowed_border=0,
pos_weight=-1,
debug=False),
rpn_proposal=dict(
nms_pre=2000,
max_per_img=2000,
nms_post=2000,
nms=dict(type='nms', iou_threshold=0.5),
min_bbox_size=0),
rcnn=dict(
assigner=dict(
type='MaxIoUAssigner',
pos_iou_thr=0.5,
neg_iou_thr=0.5,
min_pos_iou=0.5,
match_low_quality=True,
ignore_iof_thr=-1),
sampler=dict(
type='RandomSampler',
num=512,
pos_fraction=0.25,
neg_pos_ub=-1,
add_gt_as_proposals=True),
mask_size=28,
pos_weight=-1,
debug=False)),
test_cfg=dict(
rpn=dict(
nms_pre=2000,
nms_post=2000,
max_per_img=2000,
nms=dict(type='nms', iou_threshold=0.5),
min_bbox_size=0),
rcnn=dict(
score_thr=0.05,
nms=dict(type='nms', iou_threshold=0.1),
max_per_img=1000,
mask_thr_binary=0.5),
postprocess=dict(type='PostLGPMA', refine_bboxes=False)))
train_cfg = None
test_cfg = None
dataset_type = 'TableRcgDataset'
data_root = ''
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='DavarLoadImageFromFile'),
dict(
type='DavarLoadTableAnnotations',
with_bbox=True,
with_enlarge_bbox=True,
with_label=True,
with_poly_mask=True,
with_empty_bbox=True),
dict(
type='DavarResize',
img_scale=[(360, 480), (960, 1080)],
keep_ratio=True,
multiscale_mode='range'),
dict(
type='Normalize',
mean=[123.675, 116.28, 103.53],
std=[58.395, 57.12, 57.375],
to_rgb=True),
dict(type='Pad', size_divisor=32),
dict(
type='GPMADataGeneration',
lib_name='gpma_data.so',
lib_dir=
'/home/zioudiahmed/Desktop/projet/DAVAR-Lab-OCR/davarocr/davar_table/datasets/pipelines/lib/'
),
dict(type='DavarDefaultFormatBundle'),
dict(
type='DavarCollect',
keys=['img', 'gt_bboxes', 'gt_labels', 'gt_masks', 'gt_semantic_seg'])
]
val_pipeline = [
dict(type='DavarLoadImageFromFile'),
dict(
type='MultiScaleFlipAug',
scale_factor=1.5,
flip=False,
transforms=[
dict(type='DavarResize', keep_ratio=True),
dict(
type='Normalize',
mean=[123.675, 116.28, 103.53],
std=[58.395, 57.12, 57.375],
to_rgb=True),
dict(type='Pad', size_divisor=32),
dict(type='DavarDefaultFormatBundle'),
dict(type='DavarCollect', keys=['img'])
])
]
test_pipeline = [
dict(type='DavarLoadImageFromFile'),
dict(
type='MultiScaleFlipAug',
scale_factor=1.5,
flip=False,
transforms=[
dict(type='DavarResize', keep_ratio=True),
dict(
type='Normalize',
mean=[123.675, 116.28, 103.53],
std=[58.395, 57.12, 57.375],
to_rgb=True),
dict(type='Pad', size_divisor=32),
dict(type='DavarDefaultFormatBundle'),
dict(type='DavarCollect', keys=['img'])
])
]
data = dict(
samples_per_gpu=1,
workers_per_gpu=1,
train=dict(
type='TableRcgDataset',
ann_file=
'/home/zioudiahmed/Desktop/projet/ann_file_train/ann_file_train.json',
img_prefix='/home/zioudiahmed/Desktop/projet/img_prefix_train',
pipeline=[
dict(type='DavarLoadImageFromFile'),
dict(
type='DavarLoadTableAnnotations',
with_bbox=True,
with_enlarge_bbox=True,
with_label=True,
with_poly_mask=True,
with_empty_bbox=True),
dict(
type='DavarResize',
img_scale=[(360, 480), (960, 1080)],
keep_ratio=True,
multiscale_mode='range'),
dict(
type='Normalize',
mean=[123.675, 116.28, 103.53],
std=[58.395, 57.12, 57.375],
to_rgb=True),
dict(type='Pad', size_divisor=32),
dict(
type='GPMADataGeneration',
lib_name='gpma_data.so',
lib_dir=
'/home/zioudiahmed/Desktop/projet/DAVAR-Lab-OCR/davarocr/davar_table/datasets/pipelines/lib/'
),
dict(type='DavarDefaultFormatBundle'),
dict(
type='DavarCollect',
keys=[
'img', 'gt_bboxes', 'gt_labels', 'gt_masks',
'gt_semantic_seg'
])
]),
val=dict(
type='TableRcgDataset',
ann_file=
'/home/zioudiahmed/Desktop/projet/ann_file_valann_file_val.json',
img_prefix='/home/zioudiahmed/Desktop/projetimg_prefix_val',
pipeline=[
dict(type='DavarLoadImageFromFile'),
dict(
type='MultiScaleFlipAug',
scale_factor=1.5,
flip=False,
transforms=[
dict(type='DavarResize', keep_ratio=True),
dict(
type='Normalize',
mean=[123.675, 116.28, 103.53],
std=[58.395, 57.12, 57.375],
to_rgb=True),
dict(type='Pad', size_divisor=32),
dict(type='DavarDefaultFormatBundle'),
dict(type='DavarCollect', keys=['img'])
])
]),
test=dict(
type='TableRcgDataset',
ann_file=
'/home/zioudiahmed/Desktop/projet/ann_file_test/ann_file_test.json',
img_prefix='/home/zioudiahmed/Desktop/projet/img_prefix_test',
pipeline=[
dict(type='DavarLoadImageFromFile'),
dict(
type='MultiScaleFlipAug',
scale_factor=1.5,
flip=False,
transforms=[
dict(type='DavarResize', keep_ratio=True),
dict(
type='Normalize',
mean=[123.675, 116.28, 103.53],
std=[58.395, 57.12, 57.375],
to_rgb=True),
dict(type='Pad', size_divisor=32),
dict(type='DavarDefaultFormatBundle'),
dict(type='DavarCollect', keys=['img'])
])
],
samples_per_gpu=1))
optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0001)
optimizer_config = dict(grad_clip=dict(max_norm=35, norm_type=2))
lr_config = dict(
policy='step',
warmup='linear',
warmup_iters=1000,
warmup_ratio=0.3333333333333333,
step=[6, 10])
runner = dict(type='EpochBasedRunner', max_epochs=12)
checkpoint_config = dict(
interval=1, filename_tmpl='checkpoint/maskrcnn-lgpma-pub-e{}.pth')
log_config = dict(interval=10, hooks=[dict(type='TextLoggerHook')])
dist_params = dict(backend='nccl')
log_level = 'INFO'
work_dir = 'projet'
load_from = None
resume_from = None
workflow = [('train', 1)]
gpu_ids = range(0, 1)
evaluation_metric = 'TEDS'
evaluation = dict(
eval_func_params=dict(ENLARGE_ANN_BBOXES=True, IOU_CONSTRAINT=0.5),
metric='TEDS',
by_epoch=True,
interval=1,
eval_mode='general',
save_best='TEDS',
rule='greater')

2023-07-06 23:45:31,005 - mmdet - INFO - load model from: /home/zioudiahmed/Desktop/projet/DAVAR-Lab-OCR/resnet50-19c8e357.pth
2023-07-06 23:45:31,005 - mmdet - INFO - Use load_from_local loader
2023-07-06 23:45:31,153 - mmdet - WARNING - The model and loaded state dict do not match exactly

unexpected key in source state_dict: fc.weight, fc.bias

Traceback (most recent call last):
File "tools/train.py", line 255, in
main()
File "tools/train.py", line 244, in main
train_model(
File "/home/zioudiahmed/Desktop/projet/DAVAR-Lab-OCR/davarocr/davar_common/apis/train.py", line 80, in train_model
model = MMDistributedDataParallel(
File "/home/zioudiahmed/.local/lib/python3.8/site-packages/torch/nn/parallel/distributed.py", line 379, in init
self.process_group = _get_default_group()
File "/home/zioudiahmed/.local/lib/python3.8/site-packages/torch/distributed/distributed_c10d.py", line 286, in _get_default_group
raise RuntimeError("Default process group has not been initialized, "
RuntimeError: Default process group has not been initialized, please make sure to call init_process_group.

@ahmedzioudi ahmedzioudi changed the title TypeError: TableRcgDataset: __init__() got an unexpected keyword argument 'val' train with 1 gpu Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant