Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

data_index is not defined #337

Open
ahmedahmedov opened this issue Feb 5, 2020 · 0 comments
Open

data_index is not defined #337

ahmedahmedov opened this issue Feb 5, 2020 · 0 comments

Comments

@ahmedahmedov
Copy link

Hi,
I get the following error when trying to execute the Word2Vec Tensorflow example

NameError Traceback (most recent call last)
in ()
13 for step in range(1, num_steps + 1):
14 # Get a new batch of data
---> 15 batch_x, batch_y = next_batch(batch_size, num_skips, skip_window)
16 # Run training op
17 _, loss = sess.run([train_op, loss_op], feed_dict={X: batch_x, Y: batch_y})

in next_batch(batch_size, num_skips, skip_window)
9 span = 2 * skip_window + 1
10 buffer = collections.deque(maxlen=span)
---> 11 if data_index + span > len(data):
12 data_index = 0
13 buffer.extend(data[data_index:data_index + span])

NameError: name 'data_index' is not defined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant