if os.path.isdir(args.input):
input, meta = guess_inputs(args.input)
else:
assert args.meta is not None
meta = args.meta
input = args.input
// this script does not need GPU
After Change
for name in var_to_dump:
assert name in dic, "Variable {} not found in the model!".format(name)
else:
var_to_dump = set(dic.keys())
dic_to_dump = {k: v for k, v in six.iteritems(dic) if k in var_to_dump}
varmanip.save_chkpt_vars(dic_to_dump, args.output)