aymericdamien / TensorFlow-Examples

TensorFlow Tutorial and Examples for Beginners (support TF v1 & v2)
Other
43.44k stars 14.94k forks source link

data_index is not defined #337

Open ahmedahmedov opened 4 years ago

ahmedahmedov commented 4 years ago

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