diff --git a/kraken/lib/layers.py b/kraken/lib/layers.py index a937fdd32..984c59996 100644 --- a/kraken/lib/layers.py +++ b/kraken/lib/layers.py @@ -10,11 +10,11 @@ from torch.nn import functional as F from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence -logger = logging.getLogger('coremltools') -logger.setLevel(logging.ERROR) +root_logger = logging.getLogger() +level = root_logger.getEffectiveLevel() +root_logger.setLevel(logging.ERROR) from coremltools.proto import NeuralNetwork_pb2 # NOQA - -logger.setLevel(logging.WARNING) +root_logger.setLevel(level) # all tensors are ordered NCHW, the "feature" dimension is C, so the output of # an LSTM will be put into C same as the filters of a CNN. diff --git a/kraken/lib/vgsl.py b/kraken/lib/vgsl.py index 9a4f0759b..083abbe25 100644 --- a/kraken/lib/vgsl.py +++ b/kraken/lib/vgsl.py @@ -9,8 +9,6 @@ Tuple, Union) import torch -from coremltools.models import MLModel, datatypes -from coremltools.models.neural_network import NeuralNetworkBuilder from google.protobuf.message import DecodeError from torch import nn @@ -18,6 +16,13 @@ from kraken.lib.codec import PytorchCodec from kraken.lib.exceptions import KrakenInvalidModelException +root_logger = logging.getLogger() +level = root_logger.getEffectiveLevel() +root_logger.setLevel(logging.ERROR) +from coremltools.models import MLModel, datatypes +from coremltools.models.neural_network import NeuralNetworkBuilder +root_logger.setLevel(level) + # all tensors are ordered NCHW, the "feature" dimension is C, so the output of # an LSTM will be put into C same as the filters of a CNN.