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

楼主的chat_bot_seq2seq_attention能跑起来吗? #49

Open
tyongguang opened this issue Nov 4, 2019 · 8 comments
Open

楼主的chat_bot_seq2seq_attention能跑起来吗? #49

tyongguang opened this issue Nov 4, 2019 · 8 comments

Comments

@tyongguang
Copy link

发现一些小错啊?
比如:
train.py 中的
“model.restore(sess, ckpt.model_checkpoint_path)”
应改为:
"model.saver.restore(sess, ckpt.model_checkpoint_path)"

predict.py 中的
from data_helpers import loadDataset, getBatches, sentence2enco
应改为:
from data_loader import loadDataset, getBatches, sentence2enco

predict跑起来还有其它一屏又一屏的错,我只是想问一下楼主,是否真能跑起来?

@tyongguang
Copy link
Author

把beam_search相关的注释打开才行。。。

@bqFirst
Copy link

bqFirst commented Dec 13, 2019

看起来中文的项目确实漏洞百出啊

@bqFirst
Copy link

bqFirst commented Dec 13, 2019

把beam_search相关的注释打开才行。。。

predict跑起来了吗

@tyongguang
Copy link
Author

把beam_search相关的注释打开才行。。。

predict跑起来了吗

能predict 起来。但绝对不是你想像中那样子:
第一,输入输出都是英文
第二,效果很差

@bqFirst
Copy link

bqFirst commented Dec 16, 2019

把beam_search相关的注释打开才行。。。

predict跑起来了吗

能predict 起来。但绝对不是你想像中那样子:
第一,输入输出都是英文
第二,效果很差

嗯嗯,跑起来了,训练数据都是英文的,输入中文的话不知道能不能理解,确实答非所问

@shengqiangzhang
Copy link

把beam_search相关的注释打开才行。。。

predict跑起来了吗

能predict 起来。但绝对不是你想像中那样子:
第一,输入输出都是英文
第二,效果很差

嗯嗯,跑起来了,训练数据都是英文的,输入中文的话不知道能不能理解,确实答非所问

请问tf版本是多少?我在predict出错了。
报错如下:

2019-12-17 14:15:28.290374: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Input to reshape is a tensor with 1024 values, but the requested shape has 5120
	 [[Node: decoder/Reshape_4 = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](decoder/AttentionWrapperZeroState/zeros_1, decoder/concat_4)]]
2019-12-17 14:15:28.290477: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Input to reshape is a tensor with 1024 values, but the requested shape has 5120
	 [[Node: decoder/Reshape_4 = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](decoder/AttentionWrapperZeroState/zeros_1, decoder/concat_4)]]
2019-12-17 14:15:28.290502: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Input to reshape is a tensor with 1024 values, but the requested shape has 5120
	 [[Node: decoder/Reshape_4 = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](decoder/AttentionWrapperZeroState/zeros_1, decoder/concat_4)]]
2019-12-17 14:15:28.290489: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Input to reshape is a tensor with 1024 values, but the requested shape has 5120
	 [[Node: decoder/Reshape_4 = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](decoder/AttentionWrapperZeroState/zeros_1, decoder/concat_4)]]
2019-12-17 14:15:28.290570: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Input to reshape is a tensor with 1024 values, but the requested shape has 5120
	 [[Node: decoder/Reshape_4 = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](decoder/AttentionWrapperZeroState/zeros_1, decoder/concat_4)]]
2019-12-17 14:15:28.290810: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Input to reshape is a tensor with 1024 values, but the requested shape has 5120
	 [[Node: decoder/Reshape_4 = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](decoder/AttentionWrapperZeroState/zeros_1, decoder/concat_4)]]
2019-12-17 14:15:28.290841: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Input to reshape is a tensor with 1024 values, but the requested shape has 5120
	 [[Node: decoder/Reshape_4 = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](decoder/AttentionWrapperZeroState/zeros_1, decoder/concat_4)]]
Traceback (most recent call last):
  File "/home/zsq/anaconda3/envs/tf1.4/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1323, in _do_call
    return fn(*args)
  File "/home/zsq/anaconda3/envs/tf1.4/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1302, in _run_fn
    status, run_metadata)
  File "/home/zsq/anaconda3/envs/tf1.4/lib/python3.6/site-packages/tensorflow/python/framework/errors_impl.py", line 473, in __exit__
    c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.InvalidArgumentError: Input to reshape is a tensor with 1024 values, but the requested shape has 5120
	 [[Node: decoder/Reshape_4 = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](decoder/AttentionWrapperZeroState/zeros_1, decoder/concat_4)]]
	 [[Node: encoder/rnn/All/_55 = _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_69_encoder/rnn/All", tensor_type=DT_BOOL, _device="/job:localhost/replica:0/task:0/device:CPU:0"]()]]

@bqFirst
Copy link

bqFirst commented Dec 17, 2019

把beam_search相关的注释打开才行。。。

predict跑起来了吗

能predict 起来。但绝对不是你想像中那样子:
第一,输入输出都是英文
第二,效果很差

嗯嗯,跑起来了,训练数据都是英文的,输入中文的话不知道能不能理解,确实答非所问

请问tf版本是多少?我在predict出错了。
报错如下:

2019-12-17 14:15:28.290374: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Input to reshape is a tensor with 1024 values, but the requested shape has 5120
	 [[Node: decoder/Reshape_4 = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](decoder/AttentionWrapperZeroState/zeros_1, decoder/concat_4)]]
2019-12-17 14:15:28.290477: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Input to reshape is a tensor with 1024 values, but the requested shape has 5120
	 [[Node: decoder/Reshape_4 = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](decoder/AttentionWrapperZeroState/zeros_1, decoder/concat_4)]]
2019-12-17 14:15:28.290502: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Input to reshape is a tensor with 1024 values, but the requested shape has 5120
	 [[Node: decoder/Reshape_4 = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](decoder/AttentionWrapperZeroState/zeros_1, decoder/concat_4)]]
2019-12-17 14:15:28.290489: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Input to reshape is a tensor with 1024 values, but the requested shape has 5120
	 [[Node: decoder/Reshape_4 = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](decoder/AttentionWrapperZeroState/zeros_1, decoder/concat_4)]]
2019-12-17 14:15:28.290570: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Input to reshape is a tensor with 1024 values, but the requested shape has 5120
	 [[Node: decoder/Reshape_4 = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](decoder/AttentionWrapperZeroState/zeros_1, decoder/concat_4)]]
2019-12-17 14:15:28.290810: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Input to reshape is a tensor with 1024 values, but the requested shape has 5120
	 [[Node: decoder/Reshape_4 = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](decoder/AttentionWrapperZeroState/zeros_1, decoder/concat_4)]]
2019-12-17 14:15:28.290841: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Input to reshape is a tensor with 1024 values, but the requested shape has 5120
	 [[Node: decoder/Reshape_4 = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](decoder/AttentionWrapperZeroState/zeros_1, decoder/concat_4)]]
Traceback (most recent call last):
  File "/home/zsq/anaconda3/envs/tf1.4/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1323, in _do_call
    return fn(*args)
  File "/home/zsq/anaconda3/envs/tf1.4/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1302, in _run_fn
    status, run_metadata)
  File "/home/zsq/anaconda3/envs/tf1.4/lib/python3.6/site-packages/tensorflow/python/framework/errors_impl.py", line 473, in __exit__
    c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.InvalidArgumentError: Input to reshape is a tensor with 1024 values, but the requested shape has 5120
	 [[Node: decoder/Reshape_4 = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](decoder/AttentionWrapperZeroState/zeros_1, decoder/concat_4)]]
	 [[Node: encoder/rnn/All/_55 = _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_69_encoder/rnn/All", tensor_type=DT_BOOL, _device="/job:localhost/replica:0/task:0/device:CPU:0"]()]]

不是tf的问题,训练和预测时不要用beam_search(beam_search=False)

@shengqiangzhang
Copy link

shengqiangzhang commented Dec 17, 2019 via email

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

3 participants