mmdetection: [Bug] AttributeError: 'ConfigDict' object has no attribute 'log_level'
Prerequisite
- I have searched Issues and Discussions but cannot get the expected help.
- I have read the FAQ documentation but cannot get the expected help.
- The bug has not been fixed in the latest version (master) or latest version (3.x).
Task
I have modified the scripts/configs, or I’m working on my own tasks/models/datasets.
Branch
master branch https://github.com/open-mmlab/mmdetection
Environment
I have installed all of the required packages that are required to run mmDetection. I have also tried reinstalling packages, setting up new Conda environments and reinstalling mmDetection. I am currently working on training mmDetection with a custom dataset using the tutorial on the official mmLab website, however something has gone wrong. I try to run the programme using the command at the bottom of the tutorial however it does not work.
Reproduces the problem - code sample
# The new config inherits a base config to highlight the necessary modification
base_ = 'configs/mask_rcnn/mask_rcnn_r50_caffe_fpn_1x_coco.py'
# We also need to change the num_classes in head to match the dataset's annotation
# dict is a python dictionary object which is used to save or load models from PyTorch
model=dict(
roi_head=dict(
# defining the number of classes a bounding box can go around
bbox_head=dict(num_classes=1),
#
mask_head=dict(num_classes=1)))
# Modify dataset related settings
dataset_type = 'COCODataset'
#Defining the classes
classes = ('Pantograph')
#grabbing the dataset so it can read the classes and train off the dataset
data=dict(
train=dict(
dataset=dict(
img_prefix='balloon/train',
classes=classes,
ann_file='balloon/train/Pan2_COCO.json'),
val=dict(
img_prefix='balloon/val',
classes=classes,
ann_file='balloon/val/Pan2_COCO.json'),
test=dict(
img_prefix='balloon/val',
classes=classes,
ann_file='val/Pan2_COCO.json')))
# We can use the pre-trained Mask RCNN model to obtain higher performance
load_from = 'checkpoints/mask_rcnn_r50_caffe_fpn_mstrain-poly_3x_coco_bbox_mAP-0.408__segm_mAP-0.37_20200504_163245-42aa3d00.pth'
Reproduces the problem - command or script
python tools/train.py configs/balloon/mask_rcnn_r50_caffe_fpn_mstrain-poly_1x_balloon.py
Reproduces the problem - error message
Traceback (most recent call last):
File "tools/train.py", line 244, in <module>
main()
File "tools/train.py", line 184, in main
logger = get_root_logger(log_file=log_file, log_level=cfg.log_level)
File "/home/dtl-admin/miniconda3/envs/mmdet/lib/python3.8/site-packages/mmcv/utils/config.py", line 519, in __getattr__
return getattr(self._cfg_dict, name)
File "/home/dtl-admin/miniconda3/envs/mmdet/lib/python3.8/site-packages/mmcv/utils/config.py", line 50, in __getattr__
raise ex
AttributeError: 'ConfigDict' object has no attribute 'log_level'
Additional information
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 35 (16 by maintainers)
you can have a try add
log_level = 'INFO'in your config and try againYou should try to make your data the same as that dataset. Check whether the label and coco format are correct.
you can refer this config:
notice that:
it should be
or you can refer this