MCPcopy Create free account
hub / github.com/OpenGVLab/HumanBench / load_last_iter

Function load_last_iter

PATH/core/utils.py:116–124  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

114 torch.save(state, '{}/{}_iter_{}.pth.tar'.format(path, filename, step))
115
116def load_last_iter(path):
117 if os.path.isfile(path):
118 checkpoint = torch.load(path, map_location='cpu')
119 dist.barrier()
120 print("=> loaded last_iter={} from {}".format(checkpoint['step'], path))
121 dist.barrier()
122 return checkpoint['step']
123 else:
124 raise RuntimeError("=> no checkpoint found at {}".format(path))
125
126
127def remove_prefix_string(string, prefix):

Callers

nothing calls this directly

Calls 1

loadMethod · 0.45

Tested by

no test coverage detected