---------------------------------------------------------------------------
KeyboardInterrupt Traceback (most recent call last)
<ipython-input-37-f99444d5bdb2> in <module>()
----> 1 accuracy = accuracy()
<ipython-input-32-2593a2dd52a9> in accuracy()
3 correct = 0
4 for sub_sample_in, sub_sample_out in zip(seq_in, seq_out):
----> 5 ypred = model.predict_on_batch(np.expand_dims(sub_sample_in, axis=0))[0]
6 ytrue = sub_sample_out
7 pred_word = word2vec_model.similar_by_vector(ypred)[0][0]
/home/user/venvs/autofill/lib/python3.5/site-packages/keras/models.py in predict_on_batch(self, x)
914 if self.model is None:
915 self.build()
--> 916 return self.model.predict_on_batch(x)
917
918 def train_on_batch(self, x, y, class_weight=None,
/home/user/venvs/autofill/lib/python3.5/site-packages/keras/engine/training.py in predict_on_batch(self, x)
1694 ins = x
1695 self._make_predict_function()
-> 1696 outputs = self.predict_function(ins)
1697 if len(outputs) == 1:
1698 return outputs[0]
/home/user/venvs/autofill/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py in __call__(self, inputs)
2227 session = get_session()
2228 updated = session.run(self.outputs + [self.updates_op],
-> 2229 feed_dict=feed_dict)
2230 return updated[:len(self.outputs)]
2231
/home/user/venvs/autofill/lib/python3.5/site-packages/tensorflow/python/client/session.py 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/user/venvs/autofill/lib/python3.5/site-packages/tensorflow/python/client/session.py in _run(self, handle, fetches, feed_dict, options, run_metadata)
980 if final_fetches or final_targets:
981 results = self._do_run(handle, final_targets, final_fetches,
--> 982 feed_dict_string, options, run_metadata)
983 else:
984 results = []
/home/user/venvs/autofill/lib/python3.5/site-packages/tensorflow/python/client/session.py in _do_run(self, handle, target_list, fetch_list, feed_dict, options, run_metadata)
1030 if handle is None:
1031 return self._do_call(_run_fn, self._session, feed_dict, fetch_list,
-> 1032 target_list, options, run_metadata)
1033 else:
1034 return self._do_call(_prun_fn, self._session, handle, feed_dict,
/home/user/venvs/autofill/lib/python3.5/site-packages/tensorflow/python/client/session.py in _do_call(self, fn, *args)
1037 def _do_call(self, fn, *args):
1038 try:
-> 1039 return fn(*args)
1040 except errors.OpError as e:
1041 message = compat.as_text(e.message)
/home/user/venvs/autofill/lib/python3.5/site-packages/tensorflow/python/client/session.py in _run_fn(session, feed_dict, fetch_list, target_list, options, run_metadata)
1019 return tf_session.TF_Run(session, options,
1020 feed_dict, fetch_list, target_list,
-> 1021 status, run_metadata)
1022
1023 def _prun_fn(session, handle, feed_dict, fetch_list):
/usr/lib/python3.5/contextlib.py in __exit__(self, type, value, traceback)
64 if type is None:
65 try:
---> 66 next(self.gen)
67 except StopIteration:
68 return
/home/user/venvs/autofill/lib/python3.5/site-packages/tensorflow/python/framework/errors_impl.py in raise_exception_on_not_ok_status()
460 try:
461 yield status
--> 462 if pywrap_tensorflow.TF_GetCode(status) != 0:
463 raise _make_specific_exception(
464 None, None,
KeyboardInterrupt: