def inferrence(args):
    args.load_model = True

    class Dummy():
        pass
    train_env = Dummy()
    infer_env = Dummy()
    (_, infer_graph) = model(args, train_env, infer_env)
    args.data = 'wikisql'
    args.load_data = True
    (X_train, y_train) = load_data(maxlen=args.maxlen, load=args.load_data, s='train')
    (X_test, y_test) = load_data(maxlen=args.maxlen, load=args.load_data, s='test')
    (X_dev, y_dev) = load_data(maxlen=args.maxlen, load=args.load_data, s='dev')
    model2load = 'model/{}'.format(args.subset)
    sess = tf.InteractiveSession(graph=infer_graph)
    infer_env.infer_saver.restore(sess, model2load)
    print('===========dev set============')
    decode_data(sess, infer_env, X_dev, y_dev)
    em = decode_data_recover(sess, infer_env, X_dev, y_dev, 'dev')
    print('==========test set===========')
    decode_data(sess, infer_env, X_test, y_test)
    test_em = decode_data_recover(sess, infer_env, X_test, y_test, 'test')
    return
def inferrence(args):
    args.load_model = True

    class Dummy():
        pass
    train_env = Dummy()
    infer_env = Dummy()
    (_, infer_graph) = model(args, train_env, infer_env)
    args.data = 'wikisql'
    args.load_data = True
    (X_train, y_train) = load_data(maxlen=args.maxlen, load=args.load_data, s='train')
    (X_test, y_test) = load_data(maxlen=args.maxlen, load=args.load_data, s='test')
    (X_dev, y_dev) = load_data(maxlen=args.maxlen, load=args.load_data, s='dev')
    model2load = 'model/{}'.format(args.subset)
    sess = tf.InteractiveSession(graph=infer_graph)
    infer_env.infer_saver.restore(sess, model2load)
    print('===========dev set============')
    decode_data(sess, infer_env, X_dev, y_dev)
    em = decode_data_recover(sess, infer_env, X_dev, y_dev, 'dev')
    print('==========test set===========')
    decode_data(sess, infer_env, X_test, y_test)
    test_em = decode_data_recover(sess, infer_env, X_test, y_test, 'test')
    return