Closed luomai closed 6 years ago
Epoch[1/50]: 63%|█████████████████████████████████████████████████████████████████████████████████████████████▉ | 1786/2852 [02:45<01:38, 10.77it/s]Epoch [1/50]: loss 5.7929
Query > happy birthday have a nice day
Traceback (most recent call last):
File "/home/hao/Workspace/env3/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1327, in _do_call
return fn(*args)
File "/home/hao/Workspace/env3/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1312, in _run_fn
options, feed_dict, fetch_list, target_list, run_metadata)
File "/home/hao/Workspace/env3/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1420, in _call_tf_sessionrun
status, run_metadata)
File "/home/hao/Workspace/env3/lib/python3.5/site-packages/tensorflow/python/framework/errors_impl.py", line 516, in __exit__
c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.InvalidArgumentError: You must feed a value for placeholder tensor 'decode_seqs_1' with dtype int64 and shape [1,?]
[[Node: decode_seqs_1 = Placeholder[dtype=DT_INT64, shape=[1,?], _device="/job:localhost/replica:0/task:0/device:GPU:0"]()]]
[[Node: model_1/seq2seq/decode/rnn/while/Exit_6/_93 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge_472_model_1/seq2seq/decode/rnn/while/Exit_6", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:CPU:0"]()]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "main.py", line 252, in <module>
main()
File "main.py", line 247, in main
train()
File "/home/hao/Workspace/env3/lib/python3.5/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/home/hao/Workspace/env3/lib/python3.5/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/home/hao/Workspace/env3/lib/python3.5/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/hao/Workspace/env3/lib/python3.5/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "main.py", line 187, in train
sentence = inference(seed)
File "main.py", line 122, in inference
{encode_seqs2: [seed_id]})
File "/home/hao/Workspace/env3/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 905, in run
run_metadata_ptr)
File "/home/hao/Workspace/env3/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1140, in _run
feed_dict_tensor, options, run_metadata)
File "/home/hao/Workspace/env3/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1321, in _do_run
run_metadata)
File "/home/hao/Workspace/env3/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1340, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: You must feed a value for placeholder tensor 'decode_seqs_1' with dtype int64 and shape [1,?]
[[Node: decode_seqs_1 = Placeholder[dtype=DT_INT64, shape=[1,?], _device="/job:localhost/replica:0/task:0/device:GPU:0"]()]]
[[Node: model_1/seq2seq/decode/rnn/while/Exit_6/_93 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge_472_model_1/seq2seq/decode/rnn/while/Exit_6", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:CPU:0"]()]]
Caused by op 'decode_seqs_1', defined at:
File "main.py", line 252, in <module>
main()
File "main.py", line 247, in main
train()
File "/home/hao/Workspace/env3/lib/python3.5/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/home/hao/Workspace/env3/lib/python3.5/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/home/hao/Workspace/env3/lib/python3.5/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/hao/Workspace/env3/lib/python3.5/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "main.py", line 97, in train
decode_seqs2 = tf.placeholder(dtype=tf.int64, shape=[1, None], name="decode_seqs")
File "/home/hao/Workspace/env3/lib/python3.5/site-packages/tensorflow/python/ops/array_ops.py", line 1777, in placeholder
return gen_array_ops.placeholder(dtype=dtype, shape=shape, name=name)
File "/home/hao/Workspace/env3/lib/python3.5/site-packages/tensorflow/python/ops/gen_array_ops.py", line 4521, in placeholder
"Placeholder", dtype=dtype, shape=shape, name=name)
File "/home/hao/Workspace/env3/lib/python3.5/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "/home/hao/Workspace/env3/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 3290, in create_op
op_def=op_def)
File "/home/hao/Workspace/env3/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 1654, in __init__
self._traceback = self._graph._extract_stack() # pylint: disable=protected-access
InvalidArgumentError (see above for traceback): You must feed a value for placeholder tensor 'decode_seqs_1' with dtype int64 and shape [1,?]
[[Node: decode_seqs_1 = Placeholder[dtype=DT_INT64, shape=[1,?], _device="/job:localhost/replica:0/task:0/device:GPU:0"]()]]
[[Node: model_1/seq2seq/decode/rnn/while/Exit_6/_93 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge_472_model_1/seq2seq/decode/rnn/while/Exit_6", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:CPU:0"]()]]
Hi @luomai
I am not able to reproduce the error same as the logs provided by @zsdonghao. The query should'nt run till after the epoch has finished. It seems to be working fine on my machine as the inference query runs after the epoch:
Epoch [1/50]: loss 5.3191
Query > happy birthday have a nice day
> thanks bro
> thanks love you too
> thanks love you too
> thanks bro
> thank you so much
Query > donald trump won last nights presidential debate according to snap online polls
> i think i was a lot of
> i think he was a fact
> and he is a lot of the way
> i dont know what he said
> i dont think he was a good thing
Epoch[2/50]: 23%|████████████████████████████████▋ | 643/2852 [03:40<12:37, 2.92it/s]
note: I'm using tensorflow-gpu(1.10.0) and tensorlayer(1.10.1) with Python3.6.6
@luomai @pskrunner14 sorry for the error, it is caused by my environment, a simple update fix the problem.
@pskrunner14 could you create a PR from your fork please?
@luomai no problem.
Thanks a lot for the excellent PR! @pskrunner14
Hey @pskrunner14
Thanks for the great PR! We have rolled back the PR you recently submitted as the PR contains the error. Could you please have a look on it and we can merge it again? You can create a PR from your fork again or directly modify from here.
Cheers, Luo