Tensorflow-Tutorial icon indicating copy to clipboard operation
Tensorflow-Tutorial copied to clipboard

[问题]运行至第十五部分报错了,怎么解决?

Open yileye opened this issue 7 years ago • 0 comments

我是导出成py文件用ipython这个命令执行的文件

acc, _cost, _ = sess.run(fetches, feed_dict)

`--------------------------------------------------------------------------- ValueError Traceback (most recent call last) /Users/finup/gitlab/poll-parrot/demo/a.py in () 511 X_batch, y_batch = data_train.next_batch(tr_batch_size) 512 feed_dict = {X_inputs:X_batch, y_inputs:y_batch, lr:_lr, batch_size:tr_batch_size, keep_prob:0.5} --> 513 _acc, _cost, _ = sess.run(fetches, feed_dict) # the cost is the mean cost of one batch 514 _accs += _acc 515 _costs += _cost

/Users/finup/gitlab/poll-parrot/env/lib/python2.7/site-packages/tensorflow/python/client/session.pyc in run(self, fetches, feed_dict, options, run_metadata) 887 try: 888 result = self._run(None, fetches, feed_dict, options_ptr, --> 889 run_metadata_ptr) 890 if run_metadata: 891 proto_data = tf_session.TF_GetBuffer(run_metadata_ptr)

/Users/finup/gitlab/poll-parrot/env/lib/python2.7/site-packages/tensorflow/python/client/session.pyc in _run(self, handle, fetches, feed_dict, options, run_metadata) 1094 'Cannot feed value of shape %r for Tensor %r, ' 1095 'which has shape %r' -> 1096 % (np_val.shape, subfeed_t.name, str(subfeed_t.get_shape()))) 1097 if not self.graph.is_feedable(subfeed_t): 1098 raise ValueError('Tensor %s may not be fed.' % subfeed_t)

ValueError: Cannot feed value of shape (128,) for Tensor u'Inputs/X_input:0', which has shape '(?, 32)`

yileye avatar Jan 27 '18 14:01 yileye