jkkummerfeld / text2sql-data

A collection of datasets that pair questions with SQL queries.
http://jkk.name/text2sql-data/
Other
534 stars 105 forks source link

Beam Search for Attention Copying seq2seq #40

Closed mitjanikolaus closed 5 years ago

mitjanikolaus commented 5 years ago

When setting the model_param inference.beam_search.beam_width to a value greater than 1, I get the following error during inference:

ValueError: Tried to convert 'input' to a tensor and failed. Error: None values not supported.

Any help would be appreciated. Thanks! :)

Full trace:

Traceback (most recent call last):
  File "bin/infer.py", line 129, in <module>
    tf.app.run()
  File "/home/xxxxxx/miniconda3/envs/tensorflow1.3cpu/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "bin/infer.py", line 106, in main
    batch_size=FLAGS.batch_size)
  File "/home/xxxxxx/text2sql/text2sql-data/systems/sequence-to-sequence/seq2seq/inference/inference.py", line 57, in create_inference_graph
    return model(features=features, labels=labels, params=None)
  File "/home/xxxxxx/text2sql/text2sql-data/systems/sequence-to-sequence/seq2seq/models/model_base.py", line 146, in __call__
    return self._build(features, labels, params)
  File "/home/xxxxxx/text2sql/text2sql-data/systems/sequence-to-sequence/seq2seq/models/seq2seq_model.py", line 298, in _build
    decoder_output, _, = self.decode(encoder_output, features, labels)
  File "/home/xxxxxx/text2sql/text2sql-data/systems/sequence-to-sequence/seq2seq/graph_utils.py", line 38, in func_wrapper
    return templated_func(*args, **kwargs)
  File "/home/xxxxxx/miniconda3/envs/tensorflow1.3cpu/lib/python2.7/site-packages/tensorflow/python/ops/template.py", line 278, in __call__
    result = self._call_func(args, kwargs, check_for_new_variables=False)
  File "/home/xxxxxx/miniconda3/envs/tensorflow1.3cpu/lib/python2.7/site-packages/tensorflow/python/ops/template.py", line 217, in _call_func
    result = self._func(*args, **kwargs)
  File "/home/xxxxxx/text2sql/text2sql-data/systems/sequence-to-sequence/seq2seq/models/basic_seq2seq.py", line 113, in decode
    decoder = self._create_decoder(encoder_output, features, labels)
  File "/home/xxxxxx/text2sql/text2sql-data/systems/sequence-to-sequence/seq2seq/models/attention_copying_seq2seq.py", line 64, in _create_decoder
    multiples=[self.params["inference.beam_search.beam_width"]])
  File "/home/xxxxxx/miniconda3/envs/tensorflow1.3cpu/lib/python2.7/site-packages/tensorflow/python/ops/gen_array_ops.py", line 3847, in tile
    name=name)
  File "/home/xxxxxx/miniconda3/envs/tensorflow1.3cpu/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 508, in apply_op
    (input_name, err))
ValueError: Tried to convert 'input' to a tensor and failed. Error: None values not supported.

originally defined at:
  File "/home/xxxxxx/text2sql/text2sql-data/systems/sequence-to-sequence/seq2seq/graph_utils.py", line 37, in func_wrapper
    templated_func = tf.make_template(name_, func)
jkkummerfeld commented 5 years ago

My memory is that we experimented with beam search, but did not use it in the final paper. I am not surprised that the system doesn't work when you try to adjust the beam size.

Beam search would be a natural direction of improvement though!