You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
[After configuring configs/distill/mmdet/cwd/cwd_cls_head_gfl_r101_fpn_gfl_r50_fpn_1x_coco.py to train.py to run and train, and then configure and run feature_virtualization.py but reported error AssertionError: “neck” is not in the model.
which step may be missing, please help me.]
Post related information
The output of pip list | grep "mmcv\|mmrazor\|^torch"
[here]
Your config file if you modified it or created a new one.
Your train log file if you meet the problem during training.
C:\ProgramData\anaconda3\envs\MMrazor\python.exe D:\AcademicResearch\PaperCode\MMCV_tutorials\mmrazor-main\tools\visualizations\feature_visualization.py D:\AcademicResearch\PaperCode\MMCV_tutorials\mmrazor-main\data\coco\train2017\12.jpg D:\AcademicResearch\PaperCode\MMCV_tutorials\mmrazor-main\tools\work_dirs\cwd_cls_head_gfl_r101_fpn_gfl_r50_fpn_1x_coco\my20240924_cwd_cls_head_gfl_r101_fpn_gfl_r50_fpn_1x_coco.py D:\AcademicResearch\PaperCode\MMCV_tutorials\mmrazor-main\tools\visualizations\vis_configs\fpn_feature_visualization.py D:\AcademicResearch\PaperCode\MMCV_tutorials\mmrazor-main\tools\work_dirs\cwd_cls_head_gfl_r101_fpn_gfl_r50_fpn_1x_coco\epoch_10.pth --device cuda:0 --repo mmdet --use-norm --overlaid --channel-reduction pixel_wise_max
C:\ProgramData\anaconda3\envs\MMrazor\lib\site-packages\mmdet\models\dense_heads\anchor_head.py:108: UserWarning: DeprecationWarning: num_anchors is deprecated, for consistency or also use num_base_priors instead
warnings.warn('DeprecationWarning: num_anchors is deprecated, '
Loads checkpoint by http backend from path: https://download.openmmlab.com/mmdetection/v2.0/gfl/gfl_r50_fpn_1x_coco/gfl_r50_fpn_1x_coco_20200629_121244-25944287.pth
C:\ProgramData\anaconda3\envs\MMrazor\lib\site-packages\mmdet\models\dense_heads\anchor_head.py:108: UserWarning: DeprecationWarning: num_anchors is deprecated, for consistency or also use num_base_priors instead
warnings.warn('DeprecationWarning: num_anchors is deprecated, '
Loads checkpoint by http backend from path: https://download.openmmlab.com/mmdetection/v2.0/gfl/gfl_r101_fpn_mstrain_2x_coco/gfl_r101_fpn_mstrain_2x_coco_20200629_200126-dd12f847.pth
Loads checkpoint by local backend from path: D:\AcademicResearch\PaperCode\MMCV_tutorials\mmrazor-main\tools\work_dirs\cwd_cls_head_gfl_r101_fpn_gfl_r50_fpn_1x_coco\epoch_10.pth
C:\ProgramData\anaconda3\envs\MMrazor\lib\site-packages\mmengine\visualization\visualizer.py:196: UserWarning: Failed to add <class 'mmengine.visualization.vis_backend.LocalVisBackend'>, please provide the save_dir argument.
warnings.warn(f'Failed to add {vis_backend.class}, '
Traceback (most recent call last):
File "D:\AcademicResearch\PaperCode\MMCV_tutorials\mmrazor-main\tools\visualizations\feature_visualization.py", line 185, in
main(args)
File "D:\AcademicResearch\PaperCode\MMCV_tutorials\mmrazor-main\tools\visualizations\feature_visualization.py", line 143, in main
recorder_manager.initialize(model)
File "D:\AcademicResearch\PaperCode\MMCV_tutorials\mmrazor-main\mmrazor\models\task_modules\recorder\recorder_manager.py", line 106, in initialize
recorder.initialize(model)
File "D:\AcademicResearch\PaperCode\MMCV_tutorials\mmrazor-main\mmrazor\models\task_modules\recorder\base_recorder.py", line 58, in initialize
self.prepare_from_model(model)
File "D:\AcademicResearch\PaperCode\MMCV_tutorials\mmrazor-main\mmrazor\models\task_modules\recorder\module_outputs_recorder.py", line 74, in prepare_from_model
assert founded, f'"{self.source}" is not in the model.'
AssertionError: "neck" is not in the model.
Process finished with exit code 1
4. Other code you modified in the mmrazor folder.
[here]
The text was updated successfully, but these errors were encountered:
I also face this question in visualization. After several experiments, I think this is because in distill model, the neck name is differents in vis_config and your true config. For me, after I check my params, the neck name is "architecture.neck" not "neck". Because I use vis_config/fpn_feature_visualization.py as vis_config. So I changerecorders = dict( neck=dict(_scope_='mmrazor', type='ModuleOutputs', source='neck')) to recorders = dict( neck=dict(_scope_='mmrazor', type='ModuleOutputs', source='architecture.neck')). It works. I hope this can help you.
Checklist
Describe the question you meet
[After configuring configs/distill/mmdet/cwd/cwd_cls_head_gfl_r101_fpn_gfl_r50_fpn_1x_coco.py to train.py to run and train, and then configure and run feature_virtualization.py but reported error AssertionError: “neck” is not in the model.
which step may be missing, please help me.]
Post related information
pip list | grep "mmcv\|mmrazor\|^torch"
[here]
C:\ProgramData\anaconda3\envs\MMrazor\python.exe D:\AcademicResearch\PaperCode\MMCV_tutorials\mmrazor-main\tools\visualizations\feature_visualization.py D:\AcademicResearch\PaperCode\MMCV_tutorials\mmrazor-main\data\coco\train2017\12.jpg D:\AcademicResearch\PaperCode\MMCV_tutorials\mmrazor-main\tools\work_dirs\cwd_cls_head_gfl_r101_fpn_gfl_r50_fpn_1x_coco\my20240924_cwd_cls_head_gfl_r101_fpn_gfl_r50_fpn_1x_coco.py D:\AcademicResearch\PaperCode\MMCV_tutorials\mmrazor-main\tools\visualizations\vis_configs\fpn_feature_visualization.py D:\AcademicResearch\PaperCode\MMCV_tutorials\mmrazor-main\tools\work_dirs\cwd_cls_head_gfl_r101_fpn_gfl_r50_fpn_1x_coco\epoch_10.pth --device cuda:0 --repo mmdet --use-norm --overlaid --channel-reduction pixel_wise_max
C:\ProgramData\anaconda3\envs\MMrazor\lib\site-packages\mmdet\models\dense_heads\anchor_head.py:108: UserWarning: DeprecationWarning:
num_anchors
is deprecated, for consistency or also usenum_base_priors
insteadwarnings.warn('DeprecationWarning:
num_anchors
is deprecated, 'Loads checkpoint by http backend from path: https://download.openmmlab.com/mmdetection/v2.0/gfl/gfl_r50_fpn_1x_coco/gfl_r50_fpn_1x_coco_20200629_121244-25944287.pth
C:\ProgramData\anaconda3\envs\MMrazor\lib\site-packages\mmdet\models\dense_heads\anchor_head.py:108: UserWarning: DeprecationWarning:
num_anchors
is deprecated, for consistency or also usenum_base_priors
insteadwarnings.warn('DeprecationWarning:
num_anchors
is deprecated, 'Loads checkpoint by http backend from path: https://download.openmmlab.com/mmdetection/v2.0/gfl/gfl_r101_fpn_mstrain_2x_coco/gfl_r101_fpn_mstrain_2x_coco_20200629_200126-dd12f847.pth
Loads checkpoint by local backend from path: D:\AcademicResearch\PaperCode\MMCV_tutorials\mmrazor-main\tools\work_dirs\cwd_cls_head_gfl_r101_fpn_gfl_r50_fpn_1x_coco\epoch_10.pth
C:\ProgramData\anaconda3\envs\MMrazor\lib\site-packages\mmengine\visualization\visualizer.py:196: UserWarning: Failed to add <class 'mmengine.visualization.vis_backend.LocalVisBackend'>, please provide the
save_dir
argument.warnings.warn(f'Failed to add {vis_backend.class}, '
Traceback (most recent call last):
File "D:\AcademicResearch\PaperCode\MMCV_tutorials\mmrazor-main\tools\visualizations\feature_visualization.py", line 185, in
main(args)
File "D:\AcademicResearch\PaperCode\MMCV_tutorials\mmrazor-main\tools\visualizations\feature_visualization.py", line 143, in main
recorder_manager.initialize(model)
File "D:\AcademicResearch\PaperCode\MMCV_tutorials\mmrazor-main\mmrazor\models\task_modules\recorder\recorder_manager.py", line 106, in initialize
recorder.initialize(model)
File "D:\AcademicResearch\PaperCode\MMCV_tutorials\mmrazor-main\mmrazor\models\task_modules\recorder\base_recorder.py", line 58, in initialize
self.prepare_from_model(model)
File "D:\AcademicResearch\PaperCode\MMCV_tutorials\mmrazor-main\mmrazor\models\task_modules\recorder\module_outputs_recorder.py", line 74, in prepare_from_model
assert founded, f'"{self.source}" is not in the model.'
AssertionError: "neck" is not in the model.
Process finished with exit code 1
4. Other code you modified in the
mmrazor
folder.[here]
The text was updated successfully, but these errors were encountered: