Fix bug: pprint -> pformat
This commit is contained in:
parent
2e2adc761d
commit
cc0efd28ec
@ -1,9 +1,9 @@
|
|||||||
import warnings
|
import warnings
|
||||||
from pprint import pprint
|
from pprint import pformat
|
||||||
|
|
||||||
|
|
||||||
def load_model_state_dict(model, state_dict, strict=True):
|
def load_model_state_dict(model, state_dict, strict=True):
|
||||||
bad_keys = model.load_state_dict(state_dict, strict)
|
bad_keys = model.load_state_dict(state_dict, strict)
|
||||||
|
|
||||||
if bad_keys.missing_keys or bad_keys.unexpected_keys:
|
if bad_keys.missing_keys or bad_keys.unexpected_keys:
|
||||||
warnings.warn(pprint(repr(bad_keys)))
|
warnings.warn(pformat(bad_keys))
|
||||||
|
@ -47,7 +47,6 @@ def node_worker(args):
|
|||||||
node = int(os.environ['SLURM_NODEID'])
|
node = int(os.environ['SLURM_NODEID'])
|
||||||
if node == 0:
|
if node == 0:
|
||||||
pprint(vars(args))
|
pprint(vars(args))
|
||||||
args.node = node
|
|
||||||
|
|
||||||
spawn(gpu_worker, args=(node, args), nprocs=args.gpus_per_node)
|
spawn(gpu_worker, args=(node, args), nprocs=args.gpus_per_node)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user