Update get_loggers() (#4854)
* Update `set_logging()` * Update export.py * pre-commit fixes * Update LoadImages * Update LoadStreams * Update print_args * Single LOGGER definition * yolo.py fix Co-authored-by: pre-commit <pre-commit@example.com>
This commit is contained in:
1 parent
8c326a1edf
commit
7b1f7aec46
8 files changed
+84
-91
No files matched your search
+2
-5
@@ -31,11 +31,9 @@ from tensorflow import keras
|
||||
from models.common import Bottleneck, BottleneckCSP, Concat, Conv, C3, DWConv, Focus, SPP, SPPF, autopad
|
||||
from models.experimental import CrossConv, MixConv2d, attempt_load
|
||||
from models.yolo import Detect
|
||||
from utils.general import make_divisible, print_args, set_logging
|
||||
from utils.general import make_divisible, print_args, LOGGER
|
||||
from utils.activations import SiLU
|
||||
|
||||
LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class TFBN(keras.layers.Layer):
|
||||
# TensorFlow BatchNormalization wrapper
|
||||
@@ -336,7 +334,7 @@ class TFModel:
|
||||
|
||||
# Define model
|
||||
if nc and nc != self.yaml['nc']:
|
||||
print(f"Overriding {cfg} nc={self.yaml['nc']} with nc={nc}")
|
||||
LOGGER.info(f"Overriding {cfg} nc={self.yaml['nc']} with nc={nc}")
|
||||
self.yaml['nc'] = nc # override yaml value
|
||||
self.model, self.savelist = parse_model(deepcopy(self.yaml), ch=[ch], model=model, imgsz=imgsz)
|
||||
|
||||
@@ -457,7 +455,6 @@ def parse_opt():
|
||||
|
||||
|
||||
def main(opt):
|
||||
set_logging()
|
||||
run(**vars(opt))
|
||||
|
||||
|
||||
|
||||
+1
-4
@@ -20,7 +20,7 @@ if str(ROOT) not in sys.path:
|
||||
from models.common import *
|
||||
from models.experimental import *
|
||||
from utils.autoanchor import check_anchor_order
|
||||
from utils.general import check_yaml, make_divisible, print_args, set_logging, check_version
|
||||
from utils.general import check_version, check_yaml, make_divisible, print_args, LOGGER
|
||||
from utils.plots import feature_visualization
|
||||
from utils.torch_utils import copy_attr, fuse_conv_and_bn, initialize_weights, model_info, scale_img, \
|
||||
select_device, time_sync
|
||||
@@ -30,8 +30,6 @@ try:
|
||||
except ImportError:
|
||||
thop = None
|
||||
|
||||
LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class Detect(nn.Module):
|
||||
stride = None # strides computed during build
|
||||
@@ -311,7 +309,6 @@ if __name__ == '__main__':
|
||||
opt = parser.parse_args()
|
||||
opt.cfg = check_yaml(opt.cfg) # check YAML
|
||||
print_args(FILE.stem, opt)
|
||||
set_logging()
|
||||
device = select_device(opt.device)
|
||||
|
||||
# Create model
|
||||
|
||||
Reference in new issue
Block a user