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

Issue with using Beam Search Algorithm #8

Open
Maplexc opened this issue Apr 13, 2020 · 1 comment
Open

Issue with using Beam Search Algorithm #8

Maplexc opened this issue Apr 13, 2020 · 1 comment

Comments

@Maplexc
Copy link

Maplexc commented Apr 13, 2020

When setting the use_beamsearch_decode=True, it shows the ValueError: t must have statically known rank.

File "seq2seq_sleep_sleep-EDF.py", line 755, in main
run_program(hparams,FLAGS)
File "seq2seq_sleep_sleep-EDF.py", line 607, in run_program
logits, pred_outputs, loss, optimizer,dec_states = build_whole_model(hparams,char2numY,inputs,targets, dec_inputs, keep_prob_)
File "seq2seq_sleep_sleep-EDF.py", line 385, in build_whole_model
logits, pred_outputs,dec_states = build_network(hparams,char2numY,inputs, dec_inputs, keep_prob_)
File "seq2seq_sleep_sleep-EDF.py", line 295, in build_network
encoder_state = tf.contrib.seq2seq.tile_batch(encoder_state, multiplier=hparams.beam_width)
File "/home/Student/s4518991/.local/lib/python3.6/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/Student/s4518991/.local/lib/python3.6/site-packages/tensorflow/python/util/nest.py", line 515, in map_structure
structure[0], [func(*x) for x in entries],
File "/home/Student/s4518991/.local/lib/python3.6/site-packages/tensorflow/python/util/nest.py", line 515, in
structure[0], [func(*x) for x in entries],
File "/home/Student/s4518991/.local/lib/python3.6/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/Student/s4518991/.local/lib/python3.6/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

@nengwp
Copy link

nengwp commented Jul 20, 2020

设置use_beamsearch_decode = True时,它显示ValueError:t必须具有静态已知的等级。

在主
run_program(hparams,FLAGS)中的行755中的
文件“ seq2seq_sleep_sleep-EDF.py”,在运行程序
logits中的行“ seq2seq_sleep_sleep-EDF.py”,行607 ,pred_outputs,loss,optimizer,dec_states = build_whole_model(hparams,char2numY输入,目标,dec_inputs,keep_prob_)
文件“ seq2seq_sleep_sleep-EDF.py”,第385行,在build_whole_model
logits中,pred_outputs,dec_states = build_network(hparams,char2numY,inputs,dec_inputs,keep_prob_)
文件“ seq2ED-seq_sleep”。 295,位于build_network编码器状态
= tf.contrib.seq2seq.tile_batch(encoder_state,multiplier = hparams.beam_width)
文件“ /home/Student/s4518991/.local/lib/python3.6/site-packages/tensorflow/contrib/seq2seq/ python / ops / beam_search_decoder.py”,第126行,在tile_batch中
返回nest.map_structure(lambda t_:tile_batch(t,multiplier),t)
文件“ /home/Student/s4518991/.local/lib/python3.6/site-packages/tensorflow/python/util/nest.py”,第515行,在map_structure
结构[0]中,[项中的x为func(* x)],
文件“ /home/Student/s4518991/.local/lib/python3.6/site-packages/tensorflow/python/util/ nest.py”,第515行,位于
结构[0]中,[用于x项的func(* x)],
文件“ /home/Student/s4518991/.local/lib/python3.6/site-packages/tensorflow/ contrib / seq2seq / python / ops / beam_search_decoder.py“,第126行,
返回nest.map_structure(lambda t_:tile_batch(t,multiplier),t)
_tile_batch中的文件“ /home/Student/s4518991/.local/lib/python3.6/site-packages/tensorflow/contrib/seq2seq/python/ops/beam_search_decoder.py”第85行
提高ValueError(“ t必须静态已知等级”)
ValueError:t必须具有静态已知等级

I encountered the same difficulty, did you solve this problem, and if it solves, can you share the solution?

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

2 participants