[Bug] AttributeError: 'ConfigDict' object has no attribute 'log_level'
See original GitHub issuePrerequisite
- 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
Issue Analytics
- State:
- Created a year ago
- Comments:35
Top Results From Across the Web
AttributeError: 'ConfigDict' object has no attribute 'log_level'
AttributeError : 'ConfigDict' object has no attribute 'log_level' #3093 ... how did you solve the error? I met it too.
Read more >How to fix AttributeError: 'ConfigDict' object has no attribute ...
I have no idea what is wrong with the code and why it is not working. from argparse import ArgumentParser from mmdet.apis import ......
Read more >logging.config — Logging configuration — Python 3.11.1 ...
If an error is encountered during configuration, this function will raise a ValueError , TypeError , AttributeError or ImportError with a suitably ...
Read more >Logging — Flask Documentation (2.2.x)
Flask uses standard Python logging . Messages about your Flask application are logged with app.logger , which takes the same name as app.name...
Read more >redis attributeerror: 'str' object has no attribute 'items'
First argument ( redis attributeerror: 'str' object has no attribute 'items' 2021 Donate Comment and i get this error: property of a particular...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.