"tools/cfgs/git@developer.sourcefind.cn:OpenDAS/openpcdet.git" did not exist on "72c608ce1a72d674b0e3cc538b657f436be550ba"
Commit 581d64f2 authored by Gustaf Ahdritz's avatar Gustaf Ahdritz
Browse files

Remove assumption that checkpoint is a directory

parent 5fecb921
......@@ -250,7 +250,10 @@ def main(args):
model_module = OpenFoldWrapper(config)
if(args.resume_from_ckpt and args.resume_model_weights_only):
sd = get_fp32_state_dict_from_zero_checkpoint(args.resume_from_ckpt)
if(os.path.isdir(args.resume_from_ckpt)):
sd = get_fp32_state_dict_from_zero_checkpoint(args.resume_from_ckpt)
else:
sd = torch.load(args.resume_from_ckpt)
sd = {k[len("module."):]:v for k,v in sd.items()}
model_module.load_state_dict(sd)
logging.info("Successfully loaded model weights...")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment