liuyuemaicha / deep-reinforcement-learning-for-dialogue-generation-in-tensorflow Goto Github PK
View Code? Open in Web Editor NEWDeep-Reinforcement-Learning-for-Dialogue-Generation-in-tensorflow
Deep-Reinforcement-Learning-for-Dialogue-Generation-in-tensorflow
AttributeError: module 'tensorflow.python.ops.rnn_cell' has no attribute '_linear'
感谢你代码的分享~
我在train的时候觉得,在训练的时候是不是还是应该固定decode?
还有reward的计算用乘法还是减法?我看你在另一个repository用的是乘法
Prepare Chitchat data in ./grl_data/
Reading development and training data (limit: 0).
b_set length: 0
b_set length: 6
b_set length: 2
b_set length: 0
Creating st_model model with fresh parameters
Created st_model model with fresh parameters
Creating bk_model model with fresh parameters
Created bk_model model with fresh parameters
Creating cc_model model with fresh parameters
Created cc_model model with fresh parameters
Traceback (most recent call last):
File "/IR/Deep-Reinforcement-Learning-for-Dialogue-Generation-in-tensorflow-master/grl_train.py", line 473, in
tf.app.run()
File "/Library/Python/2.7/site-packages/tensorflow/python/platform/app.py", line 43, in run
sys.exit(main(sys.argv[:1] + flags_passthrough))
File "/IR/Deep-Reinforcement-Learning-for-Dialogue-Generation-in-tensorflow-master/grl_train.py", line 467, in main
train()
File "/IR/Deep-Reinforcement-Learning-for-Dialogue-Generation-in-tensorflow-master/grl_train.py", line 261, in train
rl_model = create_rl_model(sess, grl_config, False, grl_config.name_model)
File "/IR/Deep-Reinforcement-Learning-for-Dialogue-Generation-in-tensorflow-master/grl_train.py", line 99, in create_rl_model
rl_model = grl_rnn_model.grl_model(grl_config=rl_config, name_scope=name_scope, forward=forward_only)
File "/IR/Deep-Reinforcement-Learning-for-Dialogue-Generation-in-tensorflow-master/grl_rnn_model.py", line 122, in init
softmax_loss_function=softmax_loss_function)
File "/IR/Deep-Reinforcement-Learning-for-Dialogue-Generation-in-tensorflow-master/grl_seq2seq.py", line 477, in model_with_buckets
decoder_inputs[:bucket[1]])
File "/IR/Deep-Reinforcement-Learning-for-Dialogue-Generation-in-tensorflow-master/grl_rnn_model.py", line 121, in
seq2seq=lambda x, y: seq2seq_f(x, y, tf.select(self.forward_only, True, False)),
File "/IR/Deep-Reinforcement-Learning-for-Dialogue-Generation-in-tensorflow-master/grl_rnn_model.py", line 98, in seq2seq_f
dtype=dtype
File "/IR/Deep-Reinforcement-Learning-for-Dialogue-Generation-in-tensorflow-master/grl_seq2seq.py", line 401, in embedding_attention_seq2seq
lambda: decoder(False))
File "/Library/Python/2.7/site-packages/tensorflow/python/ops/control_flow_ops.py", line 1776, in cond
orig_res, res_t = context_t.BuildCondBranch(fn1)
File "/Library/Python/2.7/site-packages/tensorflow/python/ops/control_flow_ops.py", line 1677, in BuildCondBranch
r = fn()
File "/IR/Deep-Reinforcement-Learning-for-Dialogue-Generation-in-tensorflow-master/grl_seq2seq.py", line 400, in
lambda: decoder(True),
File "/IR/Deep-Reinforcement-Learning-for-Dialogue-Generation-in-tensorflow-master/grl_seq2seq.py", line 397, in decoder
return outputs + state_list
File "/Library/Python/2.7/site-packages/tensorflow/python/ops/math_ops.py", line 813, in binary_op_wrapper
y = ops.convert_to_tensor(y, dtype=x.dtype.base_dtype, name="y")
File "/Library/Python/2.7/site-packages/tensorflow/python/framework/ops.py", line 669, in convert_to_tensor
ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
File "/Library/Python/2.7/site-packages/tensorflow/python/framework/constant_op.py", line 176, in _constant_tensor_conversion_function
return constant(v, dtype=dtype, name=name)
File "/Library/Python/2.7/site-packages/tensorflow/python/framework/constant_op.py", line 165, in constant
tensor_util.make_tensor_proto(value, dtype=dtype, shape=shape, verify_shape=verify_shape))
File "/Library/Python/2.7/site-packages/tensorflow/python/framework/tensor_util.py", line 367, in make_tensor_proto
_AssertCompatible(values, dtype)
File "/Library/Python/2.7/site-packages/tensorflow/python/framework/tensor_util.py", line 302, in _AssertCompatible
(dtype.name, repr(mismatch), type(mismatch).name))
TypeError: Expected int32, got list containing Tensors of type '_Message' instead.
I don't know how to solve it. Can you give me some idea?
Thank you for helping me a lot, due to your code. Sorry, but I met some code problems that I can't solve. Looking forward to your updating!
can you give me any link of some dataset to train the model? Thanks.
你好,数据可以给个百度网盘地址吗? 非常感谢,跪求数据 qq 1206401181
The below code is defined in embedding_attention_decoder method, file name grl_seq2seq.py.
` if beam_search:
return beam_rnn_decoder(emb_inp, initial_state, cell,
embedding=embedding,
output_projection=output_projection,
beam_size=beam_size,
scope=scope)
else:
loop_function = _extract_argmax_and_embed(embedding, output_projection,
update_embedding_for_previous) if feed_previous else None
return attention_decoder(emb_inp, initial_state, attention_states, cell,
output_size=output_size,
num_heads=num_heads,
loop_function=loop_function,
initial_state_attention=initial_state_attention,
scope=scope)`
Here if the beam search is activated it initializes normal decoder. I would have expected beam search along with attention decoder?
我只用了 Ease of answering 作为reward,但是随着训练这一项从-2.x开始一直减小到负无穷。
at
python grl_train.py
Prepare Chitchat data in ./grl_data/
Tokenizing data in ./grl_data/chitchat.train.answer
Tokenizing data in ./grl_data/chitchat.train.query
Tokenizing data in ./grl_data/chitchat.dev.answer
Tokenizing data in ./grl_data/chitchat.dev.query
Reading development and training data (limit: 0).
b_set length: 0
b_set length: 6
b_set length: 2
b_set length: 0
Creating st_model model with fresh parameters
Created st_model model with fresh parameters
Creating bk_model model with fresh parameters
Created bk_model model with fresh parameters
Creating cc_model model with fresh parameters
Created cc_model model with fresh parameters
Traceback (most recent call last):
File "grl_train.py", line 473, in
tf.app.run()
File "/Users/venv/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 43, in run
sys.exit(main(sys.argv[:1] + flags_passthrough))
File "grl_train.py", line 467, in main
train()
File "grl_train.py", line 261, in train
rl_model = create_rl_model(sess, grl_config, False, grl_config.name_model)
File "grl_train.py", line 99, in create_rl_model
rl_model = grl_rnn_model.grl_model(grl_config=rl_config, name_scope=name_scope, forward=forward_only)
File "/Users/Deep-Reinforcement-Learning-for-Dialogue-Generation-in-tensorflow/grl_rnn_model.py", line 123, in init
softmax_loss_function=softmax_loss_function)
File "/Users/Deep-Reinforcement-Learning-for-Dialogue-Generation-in-tensorflow/grl_seq2seq.py", line 477, in model_with_buckets
decoder_inputs[:bucket[1]])
File "/Users/Deep-Reinforcement-Learning-for-Dialogue-Generation-in-tensorflow/grl_rnn_model.py", line 122, in
seq2seq=lambda x, y: seq2seq_f(x, y, tf.select(self.forward_only, True, False)),
File "/Users/Deep-Reinforcement-Learning-for-Dialogue-Generation-in-tensorflow/grl_rnn_model.py", line 99, in seq2seq_f
dtype=dtype
File "/Users/Deep-Reinforcement-Learning-for-Dialogue-Generation-in-tensorflow/grl_seq2seq.py", line 401, in embedding_attention_seq2seq
lambda: decoder(False))
File "/Users/venv/lib/python3.6/site-packages/tensorflow/python/ops/control_flow_ops.py", line 1776, in cond
orig_res, res_t = context_t.BuildCondBranch(fn1)
File "/Users/venv/lib/python3.6/site-packages/tensorflow/python/ops/control_flow_ops.py", line 1677, in BuildCondBranch
r = fn()
File "/Users/Deep-Reinforcement-Learning-for-Dialogue-Generation-in-tensorflow/grl_seq2seq.py", line 400, in
lambda: decoder(True),
File "/Users/Deep-Reinforcement-Learning-for-Dialogue-Generation-in-tensorflow/grl_seq2seq.py", line 397, in decoder
return outputs + state_list
File "/Users/venv/lib/python3.6/site-packages/tensorflow/python/ops/math_ops.py", line 813, in binary_op_wrapper
y = ops.convert_to_tensor(y, dtype=x.dtype.base_dtype, name="y")
File "/Users/venv/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 669, in convert_to_tensor
ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
File "/Users/venv/lib/python3.6/site-packages/tensorflow/python/framework/constant_op.py", line 176, in _constant_tensor_conversion_function
return constant(v, dtype=dtype, name=name)
File "/Users/venv/lib/python3.6/site-packages/tensorflow/python/framework/constant_op.py", line 165, in constant
tensor_util.make_tensor_proto(value, dtype=dtype, shape=shape, verify_shape=verify_shape))
File "/Users/venv/lib/python3.6/site-packages/tensorflow/python/framework/tensor_util.py", line 367, in make_tensor_proto
_AssertCompatible(values, dtype)
File "/Users/venv/lib/python3.6/site-packages/tensorflow/python/framework/tensor_util.py", line 302, in _AssertCompatible
(dtype.name, repr(mismatch), type(mismatch).name))
TypeError: Expected int32, got list containing Tensors of type '_Message' instead.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.