[Enhance] Return code 1 if scripts runs failed. (#694)
* return code 1 when run failed * return code 1 when run failedpull/720/head
parent
dd45491d14
commit
24ae53a4a0
|
@ -50,7 +50,7 @@ if __name__ == '__main__':
|
|||
dst = Path(args.dst)
|
||||
if dst.suffix != '.pth':
|
||||
print('The path should contain the name of the pth format file.')
|
||||
exit()
|
||||
exit(1)
|
||||
dst.parent.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
original_model = torch.load(args.src, map_location='cpu')
|
||||
|
|
|
@ -36,7 +36,7 @@ def main():
|
|||
save_path = Path(args.save_path)
|
||||
if save_path.suffix != '.pth':
|
||||
print('The path should contain the name of the pth format file.')
|
||||
exit()
|
||||
exit(1)
|
||||
save_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
convert_repvggblock_param(args.config_path, args.checkpoint_path,
|
||||
|
|
|
@ -50,7 +50,7 @@ def main():
|
|||
dst = Path(args.dst)
|
||||
if dst.suffix != '.pth':
|
||||
print('The path should contain the name of the pth format file.')
|
||||
exit()
|
||||
exit(1)
|
||||
dst.parent.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
convert(args.src, args.dst)
|
||||
|
|
|
@ -80,7 +80,7 @@ def main():
|
|||
args.model, class_names=dataset.CLASSES, device_id=0)
|
||||
else:
|
||||
print('Unknown backend: {}.'.format(args.model))
|
||||
exit()
|
||||
exit(1)
|
||||
|
||||
model = MMDataParallel(model, device_ids=[0])
|
||||
model.CLASSES = dataset.CLASSES
|
||||
|
|
Loading…
Reference in New Issue