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

Error occur when execute "python3 aster/demo.py #2

Closed
billqxg opened this issue Jul 24, 2018 · 10 comments
Closed

Error occur when execute "python3 aster/demo.py #2

billqxg opened this issue Jul 24, 2018 · 10 comments

Comments

@billqxg
Copy link

billqxg commented Jul 24, 2018

Traceback (most recent call last):
File "aster/demo.py", line 92, in
tf.app.run()
File "/home/abc/Envs/tf-py3/lib/python3.5/site-packages/tensorflow/python/platform/app.py", line 126, in run
_sys.exit(main(argv))
File "aster/demo.py", line 55, in main
predictions_dict = model.predict(tf.expand_dims(resized_image_tensor, 0))
File "/home/abc/Projects/aster/meta_architectures/multi_predictors_recognition_model.py", line 51, in predict
predictor_outputs = predictor.predict(feature_maps, scope='{}/Predictor'.format(name))
File "/home/abc/Projects/aster/predictors/attention_predictor.py", line 74, in predict
maximum_iterations=self._max_num_steps
File "/home/abc/Envs/tf-py3/lib/python3.5/site-packages/tensorflow/contrib/seq2seq/python/ops/decoder.py", line 309, in dynamic_decode
swap_memory=swap_memory)
File "/home/abc/Envs/tf-py3/lib/python3.5/site-packages/tensorflow/python/ops/control_flow_ops.py", line 3202, in while_loop
result = loop_context.BuildLoop(cond, body, loop_vars, shape_invariants)
File "/home/abc/Envs/tf-py3/lib/python3.5/site-packages/tensorflow/python/ops/control_flow_ops.py", line 2940, in BuildLoop
pred, body, original_loop_vars, loop_vars, shape_invariants)
File "/home/abc/Envs/tf-py3/lib/python3.5/site-packages/tensorflow/python/ops/control_flow_ops.py", line 2877, in _BuildLoop
body_result = body(*packed_vars_for_body)
File "/home/abc/Envs/tf-py3/lib/python3.5/site-packages/tensorflow/contrib/seq2seq/python/ops/decoder.py", line 254, in body
decoder_finished) = decoder.step(time, inputs, state)
File "/home/abc/Envs/tf-py3/lib/python3.5/site-packages/tensorflow/contrib/seq2seq/python/ops/beam_search_decoder.py", line 490, in step
cell_outputs, next_cell_state = self._cell(inputs, cell_state)
File "/home/abc/Envs/tf-py3/lib/python3.5/site-packages/tensorflow/python/ops/rnn_cell_impl.py", line 191, in call
return super(RNNCell, self).call(inputs, state)
File "/home/abc/Envs/tf-py3/lib/python3.5/site-packages/tensorflow/python/layers/base.py", line 714, in call
outputs = self.call(inputs, *args, **kwargs)
File "/home/abc/Projects/aster/core/sync_attention_wrapper.py", line 54, in call
self._attention_layers[i] if self._attention_layers else None)
ValueError: too many values to unpack (expected 2)

@tp-nan
Copy link

tp-nan commented Jul 27, 2018

same problem. @doudoubilly dou you have solved this problem?

@bgshih
Copy link
Owner

bgshih commented Jul 29, 2018

@doudoubilly which TF version are you using? I have reproduced this issue on the most recent TF version (r1.10) but fixing it does not seem trivial. Please try TF r1.4 first.

@billqxg
Copy link
Author

billqxg commented Jul 30, 2018

@bgshih Thanks for applying.
I have tried tf1.7,1.8 and 1.9. Since I have no PC at hand, I may try a little later.

@billqxg
Copy link
Author

billqxg commented Jul 30, 2018

@ShiyangZhang Not yet.
You can follow suggestion from others in this issue and have a try.

@zongking123
Copy link

dou you have solved this problem?

@ustczhouyu
Copy link

@bgshih 我用python3 train.py训练的时候,初始化了15行代码,到从我下载的预训练模型中恢复数据的那一步的时候就卡住了,ctrl+c也关不掉了。如下所示,
INFO:tensorflow:Scale of 0 disables regularizer.
INFO:tensorflow:Scale of 0 disables regularizer.
INFO:tensorflow:Scale of 0 disables regularizer.
INFO:tensorflow:Scale of 0 disables regularizer.
INFO:root:Number of classes is 94
INFO:root:UNK label is 2
INFO:tensorflow:Scale of 0 disables regularizer.
INFO:root:Number of classes is 94
INFO:root:UNK label is 2
INFO:tensorflow:Scale of 0 disables regularizer.
INFO:tensorflow:Scale of 0 disables regularizer.
INFO:tensorflow:Scale of 0 disables regularizer.
INFO:tensorflow:Scale of 0 disables regularizer.
INFO:tensorflow:Create CheckpointSaverHook.
INFO:tensorflow:Restoring parameters from /aster/experiments/demo/log/model.ckpt
恳请作者以及同各位跑过的大佬指导一下,非常感谢

@ww451575464
Copy link

ww451575464 commented Mar 12, 2019

ValueError: too many values to unpack (expected 2)
这个问题,在core/sync_attention_wrapper.py里面,attention, alignments, attention_state = _compute_attention,这个返回了三个值,所以添加了这个attention_state,并且在下面next_state = seq2seq.AttentionWrapperState这个里面,缺了一项,缺了attention_state这个参数,我直接将上面返回的attention_state给了这个输入,现在demo可以跑了
@bgshih 不知道这样是不是正确的

@IAmUnbounded
Copy link

It works with tensorflow version 1.4.

@billqxg billqxg closed this as completed Mar 19, 2019
@pageedward
Copy link

@sukhad-app when i run demo.py ,something wrong :
InvalidArgumentError (see above for traceback): Unsuccessful TensorSliceReader constructor: Failed to get matching files on aster/experiments/demo/log/model.ckpt: Not found: aster/experiments/demo/log; No such file or directory
,how do u fix that?

@IAmUnbounded
Copy link

I think there is some path issue due to which it is not able to find 'aster/experiments/demo/log'. You can try absolute paths or follow the installation instructions carefully to make it work. Make sure that you did not delete the given directory accidentally.

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

9 participants