Skip to content

AttributeError: ConsistentTeacher: 'NoneType' object has no attribute 'num_scores' #61

@FLYDust1101

Description

@FLYDust1101

I have 1 GPU,and i run the code for 4000iters.

Before testing, I copyed DynamicSoftLabelAssigner to ConsistentTeacher-main\thirdparty\mmdetection\mmdet\core\bbox\assigners
and change init.py

from .dynamic_assigner import DynamicSoftLabelAssigner

__all__ = [
    'BaseAssigner', 'MaxIoUAssigner', 'ApproxMaxIoUAssigner', 'AssignResult',
    'PointAssigner', 'ATSSAssigner', 'CenterRegionAssigner', 'GridAssigner',
    'HungarianAssigner', 'RegionAssigner', 'UniformAssigner', 'SimOTAAssigner',
    'TaskAlignedAssigner', 'MaskHungarianAssigner', 'DynamicSoftLabelAssigner'
]

It seems worked with following code.

from mmdet.core.bbox.builder import BBOX_ASSIGNERS
print(BBOX_ASSIGNERS)

But it still have following error when testing. Should I register Class ConsistentTeacher and class FAM3D and... like DynamicSoftLabelAssigner???

loading annotations into memory...
Done (t=0.73s)
creating index...
index created!
Traceback (most recent call last):
  File "C:\Anaconda3\envs\ct\lib\site-packages\mmcv\utils\registry.py", line 52, in build_from_cfg               
    return obj_cls(**args)                                                                                       
  File "d:\lyb\consistentteacher-main\ssod\models\consistent_teacher.py", line 33, in __init__                   
    num_scores = self.train_cfg.num_scores                                                                       
AttributeError: 'NoneType' object has no attribute 'num_scores'                                                  
                                                                                                                 
During handling of the above exception, another exception occurred:                                              
                                                                                                                 
Traceback (most recent call last):                                                                               
  File "tools/test.py", line 261, in <module>                                                                    
    main()                                                                                                       
  File "tools/test.py", line 204, in main                                                                        
    model = build_detector(cfg.model, test_cfg=cfg.get("test_cfg"))                                              
  File "d:\lyb\consistentteacher-main\thirdparty\mmdetection\mmdet\models\builder.py", line 58, in build_detector
    return DETECTORS.build(
  File "C:\Anaconda3\envs\ct\lib\site-packages\mmcv\utils\registry.py", line 212, in build
    return self.build_func(*args, **kwargs, registry=self)
  File "C:\Anaconda3\envs\ct\lib\site-packages\mmcv\cnn\builder.py", line 27, in build_model_from_cfg
    return build_from_cfg(cfg, registry, default_args)
  File "C:\Anaconda3\envs\ct\lib\site-packages\mmcv\utils\registry.py", line 55, in build_from_cfg
    raise type(e)(f'{obj_cls.__name__}: {e}')
AttributeError: ConsistentTeacher: 'NoneType' object has no attribute 'num_scores'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions