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

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

Open
yileye opened this issue Jan 27, 2018 · 0 comments
Open

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

yileye opened this issue Jan 27, 2018 · 0 comments

Comments

@yileye
Copy link

yileye commented Jan 27, 2018

我是导出成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)`

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