While loading a pretrained model with pytorch via
model.load_state_dict(torch.load(MODEL_PATH))
the console is flooded with output containing information about the model (which is annoying). Afaik there is no verbosity option, neither in model.load_state_dict
nor in torch.load
. Please let me know if I overlooked this parameter.
However, this led me to the question if there is any general way to force a function to be non verbose. Maybe something like:
with os.nonverbose():
model.load_state_dict(torch.load(MODEL_PATH))
Any ideas?