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

Lesson 19: Error while training. Please look into issue and help #7

Open
gangooteli opened this issue Nov 27, 2017 · 0 comments
Open

Comments

@gangooteli
Copy link

gangooteli commented Nov 27, 2017

Code: Lesson 19 - Seq2Seq - Date translator - Solutions.ipynb
for epoch_i in range(epochs):
start_time = time.time()
for batch_i, (source_batch, target_batch) in enumerate(batch_data(X_train, y_train, batch_size)):
_, batch_loss, batch_logits = sess.run([optimizer, loss, logits],
feed_dict = {inputs: source_batch,
outputs: target_batch[:, :-1],
targets: target_batch[:, 1:]
})

Error:
ValueError Traceback (most recent call last)
in ()
9 feed_dict = {inputs: source_batch,
10 outputs: target_batch[:, :-1],
---> 11 targets: np.array(target_batch[:, 1:])
12 })
13 accuracy = np.mean(batch_logits.argmax(axis=-1) == target_batch[:,1:])

/home/nikhil/anaconda/envs/tfone/lib/python2.7/site-packages/tensorflow/python/client/session.pyc in run(self, fetches, feed_dict, options, run_metadata)
776 try:
777 result = self._run(None, fetches, feed_dict, options_ptr,
--> 778 run_metadata_ptr)
779 if run_metadata:
780 proto_data = tf_session.TF_GetBuffer(run_metadata_ptr)

/home/nikhil/anaconda/envs/tfone/lib/python2.7/site-packages/tensorflow/python/client/session.pyc in _run(self, handle, fetches, feed_dict, options, run_metadata)
952 np_val = subfeed_val.to_numpy_array()
953 else:
--> 954 np_val = np.asarray(subfeed_val, dtype=subfeed_dtype)
955
956 if (not is_tensor_handle_feed and

/home/nikhil/anaconda/envs/tfone/lib/python2.7/site-packages/numpy/core/numeric.pyc in asarray(a, dtype, order)
529
530 """
--> 531 return array(a, dtype, copy=False, order=order)
532
533

ValueError: setting an array element with a sequence.

@gangooteli gangooteli changed the title Error while training. Please look into issue and help Lesson 19: Error while training. Please look into issue and help Nov 27, 2017
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