mmrazor
mmrazor copied to clipboard
How to distill faster_rcnn using the cwd algorithm in mmrazor?
Checklist
- I have searched related issues but cannot get the expected help.
- I have read related documents and don't know what to do.
Describe the question you meet
I tried distilling faster_rcnn using the cwd algorithm, but after typing the following command: python tools/train.py configs/distill/mmdet/cwd/cwd_fpn_frcnn_r101_frcnn_r50_1x_coco.py But the error says that the dataset JSON file was not found, but the JSON file I have configured in the mmdetection file, and there is no problem with the configuration, I have run through the faster_rcnn in mmdet, and put the teacher's weight file into mmrazor
Post related information
The error message is as follows:
loading annotations into memory... Traceback (most recent call last): File "C:\Users\12823.conda\envs\pytorch\lib\site-packages\mmengine\registry\build_functions.py", line 122, in build_from_cfg obj = obj_cls(**args) # type: ignore File "c:\users\12823\mmdetection\mmdet\datasets\base_det_dataset.py", line 40, in init super().init(*args, **kwargs) File "C:\Users\12823.conda\envs\pytorch\lib\site-packages\mmengine\dataset\base_dataset.py", line 245, in init self.full_init() File "c:\users\12823\mmdetection\mmdet\datasets\base_det_dataset.py", line 65, in full_init self.data_list = self.load_data_list() File "c:\users\12823\mmdetection\mmdet\datasets\coco.py", line 70, in load_data_list self.coco = self.COCOAPI(local_path) File "c:\users\12823\mmdetection\mmdet\datasets\api_wrappers\coco_api.py", line 25, in init super().init(annotation_file=annotation_file) File "C:\Users\12823.conda\envs\pytorch\lib\site-packages\pycocotools\coco.py", line 81, in init with open(annotation_file, 'r') as f: FileNotFoundError: [Errno 2] No such file or directory: 'data/coco/annotations/instances_train2017.json'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\12823.conda\envs\pytorch\lib\site-packages\mmengine\registry\build_functions.py", line 122, in build_from_cfg
obj = obj_cls(**args) # type: ignore
File "C:\Users\12823.conda\envs\pytorch\lib\site-packages\mmengine\runner\loops.py", line 44, in init
super().init(runner, dataloader)
File "C:\Users\12823.conda\envs\pytorch\lib\site-packages\mmengine\runner\base_loop.py", line 26, in init
self.dataloader = runner.build_dataloader(
File "C:\Users\12823.conda\envs\pytorch\lib\site-packages\mmengine\runner\runner.py", line 1346, in build_dataloader
dataset = DATASETS.build(dataset_cfg)
File "tools/train.py", line 121, in EpochBasedTrainLoop
in mmengine/runner/loops.py: class CocoDataset
in mmdet/datasets/coco.py: [Errno 2] No such file or directory: 'data/coco/annotations/instances_train2017.json'
please help me! thanks a lot!
you should put the dataset into mmrazor files,not in mmdet