问题描述:
InvalidArgumentError Traceback (most recent call last)
d:\Anaconda3\lib\site-packages\tensorflow\python\client\session.py in _do_call(self, fn, *args)
1138 try:
-> 1139 return fn(*args)
1140 except errors.OpError as e:
d:\Anaconda3\lib\site-packages\tensorflow\python\client\session.py in _run_fn(session, feed_dict, fetch_list, target_list, options, run_metadata)
1120 feed_dict, fetch_list, target_list,
-> 1121 status, run_metadata)
1122
d:\Anaconda3\lib\contextlib.py in __exit__(self, type, value, traceback)
87 try:
---> 88 next(self.gen)
89 except StopIteration:
d:\Anaconda3\lib\site-packages\tensorflow\python\framework\errors_impl.py in raise_exception_on_not_ok_status()
465 compat.as_text(pywrap_tensorflow.TF_Message(status)),
--> 466 pywrap_tensorflow.TF_GetCode(status))
467 finally:
InvalidArgumentError: Shape [-1,784] has negative dimensions
[[Node: input_2/x-input = Placeholder[dtype=DT_FLOAT, shape=[?,784], _device="/job:localhost/replica:0/task:0/gpu:0"]()]]
During handling of the above exception, another exception occurred:
InvalidArgumentError Traceback (most recent call last)
<ipython-input-15-d0fa766645c3> in <module>()
87 for batch in range(n_batch):
88 x_batch,y_batch=mnist.train.next_batch(batch_size)
---> 89 summary,_=sess.run([merged,train_step],feed_dict={
x:x_batch,y:y_batch,keep_prob:0.7})
90 writer.add_summary(summary,epoch)
91 acc=sess.run(accuracy,feed_