Code Monkey home page Code Monkey logo

nlu-hmrnn's People

Contributors

guangyuzh avatar mingshipeng avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

nlu-hmrnn's Issues

Question about working python and tensorflow versions

Hi

In running the first example of hmlstm,
I am having errors:

batches_in, batches_out = prepare_inputs(batch_size=10, truncate_len=5000,
step_size=25, text_path='text8.txt')

TypeErrorTraceback (most recent call last)
in ()
1 batches_in, batches_out = prepare_inputs(batch_size=10, truncate_len=500,
----> 2 step_size=25, text_path='text8.txt')

/usr/local/lib/python2.7/dist-packages/hmlstm/preprocessing.pyc in prepare_inputs(batch_size, truncate_len, text_path, step_size, num_batches)
68
69 if num_batches is None:
---> 70 y = text(text_path, truncate_len, step_size, batch_size)
71 num_batches = len(y) // batch_size
72 elif num_batches is not None:

/usr/local/lib/python2.7/dist-packages/hmlstm/preprocessing.pyc in text(text_path, truncate_len, step_size, batch_size, num_chars)
5
6 def text(text_path, truncate_len, step_size, batch_size, num_chars=None):
----> 7 signals = load_text(text_path, truncate_len, step_size, batch_size, num_chars)
8
9 hot = [(one_hot_encode(intext), one_hot_encode(outtext))

/usr/local/lib/python2.7/dist-packages/hmlstm/preprocessing.pyc in load_text(text_path, truncate_len, step_size, batch_size, num_chars)
15 def load_text(text_path, truncate_len, step_size, batch_size, num_chars):
16 with open(text_path, 'r') as f:
---> 17 text = f.read(num_chars)
18 text = text.replace('\n', ' ')
19 text = re.sub(' +', ' ', text).lower()

TypeError: an integer is required

Errors occur under tensorflow version 1.0 ~ 1.2

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.