DAVAR-Lab-OCR
DAVAR-Lab-OCR copied to clipboard
LGPMA train error, training with 1 GPU
(davar) hlming@hlmingPC:~/PycharmProjects/DAVAR-Lab-OCR-main$ python ./tools/train.py ./demo/table_recognition/lgpma/configs/lgpma_pub.py fatal: not a git repository (or any parent up to mount point /) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set). 2022-09-24 14:06:10,309 - davarocr - INFO - Environment info:
sys.platform: linux Python: 3.7.13 (default, Mar 29 2022, 02:18:16) [GCC 7.5.0] CUDA available: True GPU 0: NVIDIA GeForce RTX 3060 CUDA_HOME: /usr/local/cuda-11.0 NVCC: Build cuda_11.0_bu.TC445_37.28540450_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) oneAPI Math Kernel Library Version 2021.4-Product Build 20210904 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 11.0
- 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_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_80,code=sm_80;-gencode;arch=compute_37,code=compute_37
- CuDNN 8.0.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.6.0 MMCV: 1.3.4 MMCV Compiler: GCC 7.3 MMCV CUDA Compiler: 11.0 DAVAROCR: 0.6.0+
2022-09-24 14:06:10,754 - davarocr - INFO - Distributed training: False 2022-09-24 14:06:11,132 - davarocr - INFO - Config: model = dict( type='LGPMA', pretrained= '/home/hlming/PycharmProjects/DAVAR-Lab-OCR-main/checkpoints/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='/path/to/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=3, workers_per_gpu=1, train=dict( type='TableRcgDataset', ann_file= '/home/hlming/PycharmProjects/DAVAR-Lab-OCR-main/demo/table_recognition/datalist/LGPMA/datalist_train_detection_pubtabnet.json', img_prefix= '/home/hlming/PycharmProjects/TableMASTER-mmocr-master/pubtabnet/pubtabnet/', 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='/path/to/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/hlming/PycharmProjects/DAVAR-Lab-OCR-main/demo/table_recognition/datalist/LGPMA/PubTabNet_2.0.0_val.jsonl', img_prefix= '/home/hlming/PycharmProjects/TableMASTER-mmocr-master/pubtabnet/pubtabnet/', 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/hlming/PycharmProjects/DAVAR-Lab-OCR-main/demo/table_recognition/datalist/LGPMA/PubTabNet_2.0.0_val.jsonl', img_prefix= '/home/hlming/PycharmProjects/TableMASTER-mmocr-master/pubtabnet/pubtabnet/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']) ]) ], 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 = './workdir' load_from = None resume_from = None workflow = [('train', 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') gpu_ids = range(0, 1)
2022-09-24 14:06:11,336 - mmdet - INFO - load model from: /home/hlming/PycharmProjects/DAVAR-Lab-OCR-main/checkpoints/resnet50-19c8e357.pth 2022-09-24 14:06:11,336 - mmdet - INFO - Use load_from_local loader 2022-09-24 14:06:11,453 - mmdet - WARNING - The model and loaded state dict do not match exactly
unexpected key in source state_dict: fc.weight, fc.bias
fatal: not a git repository (or any parent up to mount point /) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set). Traceback (most recent call last): File "/home/hlming/anaconda3/envs/davar/lib/python3.7/site-packages/mmcv/utils/registry.py", line 51, in build_from_cfg return obj_cls(**args) File "/home/hlming/PycharmProjects/DAVAR-Lab-OCR-main/davarocr/davar_table/datasets/table_rcg_dataset.py", line 49, in init filter_empty_gt, classes_config) File "/home/hlming/PycharmProjects/DAVAR-Lab-OCR-main/davarocr/davar_common/datasets/davar_custom.py", line 116, in init data_infos = self.load_annotations(self.ann_file) File "/home/hlming/PycharmProjects/DAVAR-Lab-OCR-main/davarocr/davar_common/datasets/davar_custom.py", line 218, in load_annotations return self._load_json(ann_file) File "/home/hlming/PycharmProjects/DAVAR-Lab-OCR-main/davarocr/davar_common/datasets/davar_custom.py", line 151, in _load_json ann = json.load(load_f, object_pairs_hook=collections.OrderedDict) File "/home/hlming/anaconda3/envs/davar/lib/python3.7/json/init.py", line 296, in load parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw) File "/home/hlming/anaconda3/envs/davar/lib/python3.7/json/init.py", line 361, in loads return cls(**kw).decode(s) File "/home/hlming/anaconda3/envs/davar/lib/python3.7/json/decoder.py", line 340, in decode raise JSONDecodeError("Extra data", s, end) json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 1641)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./tools/train.py", line 255, in
"json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 1641)"
this problem seems caused by the error in the datalist JSON file
Have you solved the problem? I don't know how to do
@hlming09 help
@hlming09 help
sorry, I didn't proceed to do this in the past two months, did you solve this?
@qiaoliang6 Help. Get the same error!