[Enhance] Return code 1 if scripts runs failed. (#694)

* return code 1 when run failed

* return code 1 when run failed
pull/720/head
Ezra-Yu 2022-03-03 10:54:16 +08:00 committed by GitHub
parent dd45491d14
commit 24ae53a4a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 4 deletions

View File

@ -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')

View File

@ -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,

View File

@ -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)

View File

@ -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