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

ValueError: use_beamsearch_decode=True #13

Open
nengwp opened this issue Jul 20, 2020 · 0 comments
Open

ValueError: use_beamsearch_decode=True #13

nengwp opened this issue Jul 20, 2020 · 0 comments

Comments

@nengwp
Copy link

nengwp commented Jul 20, 2020

I used use_beamsearch_decode=True.
ValueError: t must have statically known rank

Use tf.where in 2.0, which has the same broadcast rule as np.where
Traceback (most recent call last):
File "/home/ubuntu/Code/SleepEEGNet/seq2seq_sleep_sleep-EDF-test1.py", line 772, in
tf.app.run()
File "/home/ubuntu/anaconda3/envs/tf1/lib/python3.7/site-packages/tensorflow/python/platform/app.py", line 40, in run
run(main=main, argv=argv, flags_parser=parse_flags_tolerate_undef)
File "/home/ubuntu/anaconda3/envs/tf1/lib/python3.7/site-packages/absl/app.py", line 299, in run
run_main(main, args)
File "/home/ubuntu/anaconda3/envs/tf1/lib/python3.7/site-packages/absl/app.py", line 250, in run_main
sys.exit(main(argv))
File "/home/ubuntu/Code/SleepEEGNet/seq2seq_sleep_sleep-EDF-test1.py", line 770, in main
run_program(hparams,FLAGS)
File "/home/ubuntu/Code/SleepEEGNet/seq2seq_sleep_sleep-EDF-test1.py", line 622, in run_program
logits, pred_outputs, loss, optimizer,dec_states = build_whole_model(hparams,char2numY,inputs,targets, dec_inputs, keep_prob
)
File "/home/ubuntu/Code/SleepEEGNet/seq2seq_sleep_sleep-EDF-test1.py", line 390, in build_whole_model
logits, pred_outputs,dec_states = build_network(hparams,char2numY,inputs, dec_inputs, keep_prob
)
File "/home/ubuntu/Code/SleepEEGNet/seq2seq_sleep_sleep-EDF-test1.py", line 294, in build_network
encoder_state = tf.contrib.seq2seq.tile_batch(encoder_state, multiplier=hparams.beam_width)
File "/home/ubuntu/anaconda3/envs/tf1/lib/python3.7/site-packages/tensorflow/contrib/seq2seq/python/ops/beam_search_decoder.py", line 126, in tile_batch
return nest.map_structure(lambda t
: tile_batch(t, multiplier), t)
File "/home/ubuntu/anaconda3/envs/tf1/lib/python3.7/site-packages/tensorflow/python/util/nest.py", line 515, in map_structure
structure[0], [func(*x) for x in entries],
File "/home/ubuntu/anaconda3/envs/tf1/lib/python3.7/site-packages/tensorflow/python/util/nest.py", line 515, in
structure[0], [func(*x) for x in entries],
File "/home/ubuntu/anaconda3/envs/tf1/lib/python3.7/site-packages/tensorflow/contrib/seq2seq/python/ops/beam_search_decoder.py", line 126, in
return nest.map_structure(lambda t: tile_batch(t, multiplier), t)
File "/home/ubuntu/anaconda3/envs/tf1/lib/python3.7/site-packages/tensorflow/contrib/seq2seq/python/ops/beam_search_decoder.py", line 85, in _tile_batch
raise ValueError("t must have statically known rank")
ValueError: t must have statically known rank

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