-
Notifications
You must be signed in to change notification settings - Fork 2
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
KeyError: 'RotatedFCOS: "CPMHead: \'vis_train_duration\'"' #1
Comments
Thank you, and I have already fixed it. You can set "visualize=True" in "train_config" to visualize the CPM during training, and you need to modify "store_dir" to a specific directory. |
Thank you for your reply, after your fix this issue has been resolved, but a new problem has arisen. Since I have only one target category: [ship], I made the following changes: data_root = 'data/ssdd/' classes = ('ship', ) in cpm_head.py ============>
============================================ 2024-10-11 08:22:54,412 - mmrotate - INFO - workflow: [('train', 1)], max: 6 epochs Please, how can I fix it? |
May I have a look on your config? |
base = [ data_root = 'data/ssdd/' ################################ store_dir = 'PointOBB-v2/your_absolute_vis_dir_ssdd/visualize' ##########################################PointOBB-v2/your_absolute_vis_dir_ssdd angle_version = 'le90' classes = ('ship', ) ##################################################### img_norm_cfg = dict(
data = dict( model settingsmodel = dict( |
Maybe you can try to set "dict(type='RResize', img_scale=(1024, 1024))" in "train_pipeline" |
I gradually tried to set the size of the image on the small side, and when setting img_scale=(64, 64), the code is working, but it's not appropriate for us to set the size of the image so small, and we get AP=0.000. since the number of categories in my dataset is 1(ship), I think it may be different from the DOTA dataset's number of categories, and a certain parameter needs to be changed, but I don't know exactly which parameter. |
Did img_scale=(1024, 1024) works? and its normal to have a AP=0.000 on train_cpm_stage. You need also to generate pseudo labels and train detectors. |
when img_scale=(1024, 1024),=======>>>> IndexError: index 184 is out of bounds for dimension 0 with size 184. img_scale=(1024, 1024) doesn't work, but as (1024, 1024)--->(512, 512)--->(256, 256)--->(128, 128)--->(64, 64), until (64, 64) code will work. Isn't Training CPM the first step? This is the step where this error occurs. |
but (64, 64) is too small for an image. The error is in visualization code, and what is the "max_probs" in this setting. It should be [h/self.stride[0], w/self.stride[0]] (where self.stride[0] is 4 in setting).
It is normal that AP=0 during the phase of CPM training because the network don't know the boundary of the object. Only when using pseudo label to train detector, the AP is not zero. |
Thanks for your reply, but where should I find the visualisation code, ‘max_probs’ appears in cpm_head.py and I don't find [h/self.stride[0], w/self.stride[0]]. |
Line 100~146 in "mmrotate/models/dense_heads/cpm_head.py" |
max_probs in cpm_head.py is a variable or matrix, we are not forced to make its dimensions, and I don't understand where you say [h/self.stride[0], w/self.stride[0]]? |
The error report position, the max_probs, should be [h/self.stride[0], w/self.stride[0]], and it is [256, 256] in the DOTA setting. |
I followed the installation tutorial to run the project, but there is an error, what should I do about this error?
2024-10-10 14:02:38,142 - mmrotate - INFO - Set random seed to 1029784185, deterministic: False
Traceback (most recent call last):
File "/opt/conda/envs/POBBv2/lib/python3.8/site-packages/mmcv/utils/registry.py", line 69, in build_from_cfg
return obj_cls(**args)
File "/workspace/PointOBB-v2/mmrotate/models/dense_heads/cpm_head.py", line 89, in init
if kwargs.get('train_cfg')['vis_train_duration'] is not None:
File "/opt/conda/envs/POBBv2/lib/python3.8/site-packages/mmcv/utils/config.py", line 40, in missing
raise KeyError(name)
KeyError: 'vis_train_duration'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/conda/envs/POBBv2/lib/python3.8/site-packages/mmcv/utils/registry.py", line 69, in build_from_cfg
return obj_cls(**args)
File "/workspace/PointOBB-v2/mmrotate/models/detectors/rotated_fcos.py", line 21, in init
super(RotatedFCOS, self).init(backbone, neck, bbox_head, train_cfg,
File "/workspace/PointOBB-v2/mmrotate/models/detectors/single_stage.py", line 35, in init
self.bbox_head = build_head(bbox_head)
File "/workspace/PointOBB-v2/mmrotate/models/builder.py", line 37, in build_head
return ROTATED_HEADS.build(cfg)
File "/opt/conda/envs/POBBv2/lib/python3.8/site-packages/mmcv/utils/registry.py", line 237, in build
return self.build_func(*args, **kwargs, registry=self)
File "/opt/conda/envs/POBBv2/lib/python3.8/site-packages/mmcv/cnn/builder.py", line 27, in build_model_from_cfg
return build_from_cfg(cfg, registry, default_args)
File "/opt/conda/envs/POBBv2/lib/python3.8/site-packages/mmcv/utils/registry.py", line 72, in build_from_cfg
raise type(e)(f'{obj_cls.name}: {e}')
KeyError: "CPMHead: 'vis_train_duration'"
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "tools/train.py", line 196, in
main()
File "tools/train.py", line 165, in main
model = build_detector(
File "/workspace/PointOBB-v2/mmrotate/models/builder.py", line 55, in build_detector
return ROTATED_DETECTORS.build(
File "/opt/conda/envs/POBBv2/lib/python3.8/site-packages/mmcv/utils/registry.py", line 237, in build
return self.build_func(*args, **kwargs, registry=self)
File "/opt/conda/envs/POBBv2/lib/python3.8/site-packages/mmcv/cnn/builder.py", line 27, in build_model_from_cfg
return build_from_cfg(cfg, registry, default_args)
File "/opt/conda/envs/POBBv2/lib/python3.8/site-packages/mmcv/utils/registry.py", line 72, in build_from_cfg
raise type(e)(f'{obj_cls.name}: {e}')
KeyError: 'RotatedFCOS: "CPMHead: 'vis_train_duration'"'
(POBBv2)
The text was updated successfully, but these errors were encountered: