GithubHelp home page GithubHelp logo

Support for Tensorflow 1.13 about dilated-cnn-ner HOT 4 OPEN

iesl avatar iesl commented on September 26, 2024
Support for Tensorflow 1.13

from dilated-cnn-ner.

Comments (4)

strubell avatar strubell commented on September 26, 2024

from dilated-cnn-ner.

Alaska47 avatar Alaska47 commented on September 26, 2024

I'm trying it right now. It looks like tf.flags is no longer part of the tensorflow package so I started out by switching that. From what I can see, a couple of the tensorflow classes are deprecated, so I could continue using them or switch it out.

I was wondering if you knew why I am getting this weird behavior with preprocessing inside a session vs outside. I don't have too much experience with what tensorflow does behind the scenes, so if you have any additional insight, that would be great!

from dilated-cnn-ner.

strubell avatar strubell commented on September 26, 2024

from dilated-cnn-ner.

Alaska47 avatar Alaska47 commented on September 26, 2024

I don't think so. I'm running the preprocessing as soon as I create the session.
The difference is between doing this (which takes almost twice as long)

with sv.managed_session(FLAGS.master, config=config) as sess:
            print("starting session")
            
            start = time.time()
            f = open(FLAGS.sample_text_file_name).read().strip().split("\n")
            print("{} {} {} {} {} {}".format(len(vocab_str_id_map), len(shape_str_id_map), len(char_str_id_map), len(vocab_id_str_map), len(shape_id_str_map), len(char_id_str_map)))
            sample_batches = batch_sentence_preprocess(f, vocab_str_id_map, shape_str_id_map, char_str_id_map, vocab_id_str_map, shape_id_str_map, char_id_str_map, batch_size=128)
            #print(np.asarray(sample_batches).shape)
            print("%.2f" % (time.time()-start))

           # do the actual inference here

versus doing this (which takes half as long)

start = time.time()
f = open(FLAGS.sample_text_file_name).read().strip().split("\n")
print("{} {} {} {} {} {}".format(len(vocab_str_id_map), len(shape_str_id_map), len(char_str_id_map), len(vocab_id_str_map), len(shape_id_str_map), len(char_id_str_map)))
sample_batches = batch_sentence_preprocess(f, vocab_str_id_map, shape_str_id_map, char_str_id_map, vocab_id_str_map, shape_id_str_map, char_id_str_map, batch_size=128)
print("%.2f" % (time.time()-start))

with sv.managed_session(FLAGS.master, config=config) as sess:
            print("starting session")
            ...
            # do the actual inference here

from dilated-cnn-ner.

Related Issues (20)

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.