iwangjian / textsum-gan

Tensorflow re-implementation of GAN for text summarization
134 stars 56 forks source link

ValueError: Cannot feed value of shape (4, 100) for Tensor 'Placeholder:0', which has shape '(4, 1)' #11

Open w5688414 opened 5 years ago

w5688414 commented 5 years ago

I got an error ` File "main.py", line 210, in tf.compat.v1.app.run() File "/home/eric/.local/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 40, in run _run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef) File "/home/eric/.local/lib/python3.6/site-packages/absl/app.py", line 300, in run _run_main(main, args) File "/home/eric/.local/lib/python3.6/site-packages/absl/app.py", line 251, in _run_main sys.exit(main(argv)) File "main.py", line 204, in main decoder.decode() File "/home/eric/Documents/textrank_summarization/textsum-gan/decode.py", line 108, in decode best_hyp = beam_search.run_beam_search(self._sess, self._model, self._vocab, batch) File "/home/eric/Documents/textrank_summarization/textsum-gan/beam_search.py", line 104, in run_beam_search enc_states, dec_in_state = model.run_encoder(sess, batch) File "/home/eric/Documents/textrank_summarization/textsum-gan/generator.py", line 510, in run_encoder self.global_step], feed_dict) # run the encoder File "/home/eric/.local/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 950, in run run_metadata_ptr) File "/home/eric/.local/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1149, in _run str(subfeed_t.get_shape()))) ValueError: Cannot feed value of shape (4, 100) for Tensor 'Placeholder:0', which has shape '(4, 1)'

` my tensorflow version is tensorflow (1.14.0), ubuntu 18.04 system

iwangjian commented 5 years ago

You may debug for your input data carefully, as the shape is not matched.