diff --git a/dygraph/paddleseg/utils/utils.py b/dygraph/paddleseg/utils/utils.py index 853773606af4d4c5bc996d98a5740b090688dc63..e7e3e8e871a0d1338bd6339e53eacc5d52308391 100644 --- a/dygraph/paddleseg/utils/utils.py +++ b/dygraph/paddleseg/utils/utils.py @@ -50,8 +50,8 @@ def load_entire_model(model, pretrained): if os.path.exists(pretrained): load_pretrained_model(model, pretrained) else: - raise Exception('Pretrained model is not found: {}'.format( - pretrained)) + raise Exception( + 'Pretrained model is not found: {}'.format(pretrained)) else: logger.warning('Not all pretrained params of {} to load, '\ 'training from scratch or a pretrained backbone'.format(model.__class__.__name__)) @@ -95,15 +95,18 @@ def load_pretrained_model(model, pretrained_model): model_state_dict[k] = para_state_dict[k] num_params_loaded += 1 model.set_dict(model_state_dict) - logger.info("There are {}/{} variables are loaded.".format( - num_params_loaded, len(model_state_dict))) + logger.info("There are {}/{} variables are loaded into {}.".format( + num_params_loaded, len(model_state_dict), + model.__class__.__name__)) else: raise ValueError( 'The pretrained model directory is not Found: {}'.format( pretrained_model)) else: - logger.warning('No pretrained model to load, train from scratch') + logger.info( + 'No pretrained model to load, {} will be train from scratch.'. + format(model.__class__.__name__)) def resume(model, optimizer, resume_model):