question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] AttributeError: 'ConfigDict' object has no attribute 'log_level'

See original GitHub issue

Prerequisite

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:closed
  • Created a year ago
  • Comments:35

github_iconTop GitHub Comments

2reactions
sanbuphycommented, Nov 3, 2022

you can have a try add log_level = 'INFO' in your config and try again

1reaction
sanbuphycommented, Nov 8, 2022

@sanbuphy I’ve tried it with the file conversion you sent me and it works so what do I need to do to get it to work with my dataset as they both look extremely different?

You should try to make your data the same as that dataset. Check whether the label and coco format are correct.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found