grimoire/mmdetection-to-tensorrt

Python logging should be defined for the module name - not root logger.

tehkillerbee opened this issue · 1 comments

I have noticed that mmdet2trt uses python logging set to use the root logger in some source files. This messes up logging from the main python script. Instead, mmdet2trt should use logger = logging.getLogger('mmdet2trt') whenever the logger is instantiated.

I have noticed the issue in

apis/inference.py
builder.py
build.py

My simple fix was to replace logging with the logger instance instead:

import logging
...
logger = logging.getLogger('mmdet2trt')
...
logger.warning('Can not load dataset from config. Use default CLASSES instead.')

Ill try to make a PR asap.

Fixed in #96