open-mmlab / mmdetection

OpenMMLab Detection Toolbox and Benchmark
https://mmdetection.readthedocs.io
Apache License 2.0
29.72k stars 9.48k forks source link

[Reimplementation] #10009

Open naiyuhh opened 1 year ago

naiyuhh commented 1 year ago

Prerequisite

💬 Describe the reimplementation questions

I used dino to train the crowdhuman dataset, load the crowdhuman odgt annotation file to report an error, and only modify data_type=‘CrowdHumanDataset’

Traceback (most recent call last): File "C:\Users\CAO.conda\envs\mm3.0\lib\site-packages\mmengine\registry\build_functions.py", line 121, in build_from_cfg obj = obj_cls(*args) # type: ignore File "c:\users\cao\mmdetection\mmdet\datasets\base_det_dataset.py", line 33, in init super().init(args, **kwargs) File "C:\Users\CAO.conda\envs\mm3.0\lib\site-packages\mmengine\dataset\base_dataset.py", line 247, in init self.full_init() File "c:\users\cao\mmdetection\mmdet\datasets\base_det_dataset.py", line 58, in full_init self.data_list = self.load_data_list() File "c:\users\cao\mmdetection\mmdet\datasets\coco.py", line 64, in load_data_list self.coco = self.COCOAPI(local_path) File "c:\users\cao\mmdetection\mmdet\datasets\api_wrappers\coco_api.py", line 25, in init super().init(annotation_file=annotation_file) File "C:\Users\CAO.conda\envs\mm3.0\lib\site-packages\pycocotools\coco.py", line 82, in init dataset = json.load(f) File "C:\Users\CAO.conda\envs\mm3.0\lib\json__init.py", line 293, in load return loads(fp.read(), File "C:\Users\CAO.conda\envs\mm3.0\lib\json\init__.py", line 357, in loads return _default_decoder.decode(s) File "C:\Users\CAO.conda\envs\mm3.0\lib\json\decoder.py", line 340, in decode raise JSONDecodeError("Extra data", s, end) json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 1379)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\CAO.conda\envs\mm3.0\lib\site-packages\mmengine\registry\build_functions.py", line 121, in build_from_cfg obj = obj_cls(*args) # type: ignore File "C:\Users\CAO.conda\envs\mm3.0\lib\site-packages\mmengine\runner\loops.py", line 43, in init super().init(runner, dataloader) File "C:\Users\CAO.conda\envs\mm3.0\lib\site-packages\mmengine\runner\base_loop.py", line 26, in init self.dataloader = runner.build_dataloader( File "C:\Users\CAO.conda\envs\mm3.0\lib\site-packages\mmengine\runner\runner.py", line 1333, in build_dataloader dataset = DATASETS.build(dataset_cfg) File "C:\Users\CAO.conda\envs\mm3.0\lib\site-packages\mmengine\registry\registry.py", line 548, in build return self.build_func(cfg, args, **kwargs, registry=self) File "C:\Users\CAO.conda\envs\mm3.0\lib\site-packages\mmengine\registry\build_functions.py", line 135, in build_from_cfg raise type(e)( TypeError: init() missing 2 required positional arguments: 'doc' and 'pos'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "tools/train.py", line 126, in main() File "tools/train.py", line 122, in main runner.train() File "C:\Users\CAO.conda\envs\mm3.0\lib\site-packages\mmengine\runner\runner.py", line 1656, in train self._train_loop = self.build_train_loop( File "C:\Users\CAO.conda\envs\mm3.0\lib\site-packages\mmengine\runner\runner.py", line 1448, in build_train_loop loop = LOOPS.build( File "C:\Users\CAO.conda\envs\mm3.0\lib\site-packages\mmengine\registry\registry.py", line 548, in build return self.build_func(cfg, *args, **kwargs, registry=self) File "C:\Users\CAO.conda\envs\mm3.0\lib\site-packages\mmengine\registry\build_functions.py", line 135, in build_from_cfg raise type(e)( TypeError: class EpochBasedTrainLoop in mmengine/runner/loops.py: init() missing 2 required positional arguments: 'doc' and 'pos'

Environment

python 3.8 PyTorch: 1.7.1+cu101 mmdetection 3.0.0rc6

Expected results

No response

Additional information

No response

hhaAndroid commented 1 year ago

@naiyuhh Please provide complete configuration information

naiyuhh commented 1 year ago

base = [ '../dino/dino-4scale_r50_8xb2-12e_coco.py' ] model = dict( as_two_stage=True,

#backbone = dict(
#    frozen_stages = 1,
#),
bbox_head = dict(
    num_classes=1,

))

dataset_type = 'CrowdHumanDataset' data_root = 'myCH/crowedHuman/coco/'

train_dataloader = dict( batch_size=1, dataset=dict( data_root=data_root, ann_file='annotation_train.odgt', data_prefix=dict(img='CrowdHuman_train/'), filter_cfg=dict(filter_empty_gt=True, min_size=32))) val_dataloader = dict( batch_size=2, dataset=dict( type=dataset_type, data_root=data_root, ann_file='annotation_val.odgt', data_prefix=dict(img='CrowdHuman_val/'), test_mode=True)) test_dataloader = val_dataloader

optim_wrapper = dict( type='OptimWrapper', optimizer=dict( type='AdamW', lr=0.000005, # 0.0002 for DeformDETR #原始0.0001 weight_decay=0.000002), clip_grad=dict(max_norm=0.1, norm_type=2), paramwise_cfg=dict(custom_keys={'backbone': dict(lr_mult=0.1)}) )

val_evaluator = dict( type='CrowdHumanMetric', ann_file=data_root + 'annotation_val.odgt',) test_evaluator = val_evaluator

work_dir = 'G:/LCY/源码/mmdetection-dev-3.x/work_dirs/dinoCHdata'