[bin] check torch script (#36)

* update run.sh

* [network] add code to check whether the model can be exported to torch script or not
This commit is contained in:
xiaohou 2021-12-07 11:17:47 +08:00 committed by GitHub
parent afbc1d2960
commit bd504c3cee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -164,9 +164,9 @@ def main():
# !!!IMPORTANT!!! # !!!IMPORTANT!!!
# Try to export the model by script, if fails, we should refine # Try to export the model by script, if fails, we should refine
# the code to satisfy the script export requirements # the code to satisfy the script export requirements
# if args.rank == 0: if args.rank == 0:
# script_model = torch.jit.script(model) script_model = torch.jit.script(model)
# script_model.save(os.path.join(args.model_dir, 'init.zip')) script_model.save(os.path.join(args.model_dir, 'init.zip'))
executor = Executor() executor = Executor()
# If specify checkpoint, load some info from checkpoint # If specify checkpoint, load some info from checkpoint
if args.checkpoint is not None: if args.checkpoint is not None: