GithubHelp home page GithubHelp logo

albert_vi's Issues

Cannot load trained model

Dear author,

I use this code

import sentencepiece as spm
# import tensorflow_hub as hub
import tensorflow as tf

sp = spm.SentencePieceProcessor(model_file='assets/albertvi_30k-clean.model')

input_ids = sp.encode("Tui rất là đẹp trai.")


tags = set()
# if is_training:
#   tags.add("train")
# albert_module = hub.Module("./base", tags=tags,
#                            trainable=False)
with tf.Session() as sess:
    saver = tf.compat.v1.train.import_meta_graph('base/model.ckpt-1015000.meta')
    saver.restore(sess, 'base/model.ckpt-1015000.data-00000-of-00001')

    # graph = tf.get_default_graph()

    albert_inputs = dict(
        input_ids=input_ids,
        # input_mask=input_mask,
        # segment_ids=segment_ids
    )
    # albert_outputs = model(
    #     inputs=albert_inputs,
    #     signature="tokens",
    #     as_dict=True)

# If you want to use the token-level output, use
# albert_outputs["sequence_output"] instead.
#     output_layer = albert_outputs["pooled_output"]


But It has an error

err, "a mismatch between the current graph and the graph")

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.