23 from convert_from_tensorflow
import *
26 parser = argparse.ArgumentParser(description=
'generate native mode model with weights from deep learning model')
27 parser.add_argument(
'--outdir', type=str, default=
'./', help=
'where to put generated files')
28 parser.add_argument(
'--infmt', type=str, default=
'tensorflow', help=
'format of the deep learning model')
29 parser.add_argument(
'infile', help=
'path to the deep learning model with weights')
31 return parser.parse_args()
36 if not os.path.isfile(args.infile):
37 print(
'the specified input file %s does not exist' % args.infile)
40 if not os.path.exists(args.outdir):
41 print(
'create output directory %s' % args.outdir)
44 basefile = os.path.split(args.infile)[1]
45 basefile = os.path.splitext(basefile)[0]
46 outfile = os.path.join(args.outdir, basefile) +
'.model'
48 if args.infmt ==
'tensorflow':
51 if __name__ ==
'__main__':