aaronyalai / seq2seqattn_ecm Goto Github PK
View Code? Open in Web Editor NEW(TensorFlow) Sequence to sequence with attention model, emotion regressor, and Emotional Chatting Machine.
(TensorFlow) Sequence to sequence with attention model, emotion regressor, and Emotional Chatting Machine.
How to prepare the train_category.txt and train_choice.txt files from a dialog data?
Could you provide an example how to put training data actually and test bot?
Hey,
In the following diagrams:
Predicted Choices for emotion words
True Choices
What does Sample, Choice and Time represent respectively ?
And what is the count for each? 5 and 25?
Also what does the colour for each category represent? I think it's some kind of heat map, right?
Hi!
After I finish the train of ECM, a error happened in the infer_ECM.py.
It seems perhaps like a problem like that, but I am not sure about it.
Could you have a look?
https://github.com/tensorflow/tensorflow/issues/2734
(env3) MorpheusdeMacBook-Pro:Seq2seqAttnTF morpheus$ python infer_ECM.py
Initializing embeddings ...
Done.
Building model architecture ...
Done.
2018-05-31 22:41:23.151156: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
Trying to restore saved checkpoints from ./log_ECM/ ... Checkpoint found: ./log_ECM/model.ckpt-4998
Global step was: 4998
Restoring... Done.
Loading inference data ...
Done.
Start inferring ...
Traceback (most recent call last):
File "/Users/morpheus/.pyenv/versions/env3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1361, in _do_call
return fn(*args)
File "/Users/morpheus/.pyenv/versions/env3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1340, in _run_fn
target_list, status, run_metadata)
File "/Users/morpheus/.pyenv/versions/env3/lib/python3.6/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: indices[1,0] = 1009 is not in [0, 1003)
[[Node: EmotionChattingMachine_1/EmotionChattingMachine_decoder/decoding/while/embedding_lookup = Gather[Tindices=DT_INT32, Tparams=DT_FLOAT, _class=["loc:@EmotionChattingMachine/concat"], validate_indices=true, _device="/job:localhost/replica:0/task:0/device:CPU:0"](EmotionChattingMachine_1/EmotionChattingMachine_decoder/decoding/while/embedding_lookup/Enter, EmotionChattingMachine_1/EmotionChattingMachine_decoder/decoding/while/mod)]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "infer_ECM.py", line 154, in
main(args)
File "infer_ECM.py", line 122, in main
feed_dict={source_ids: batch, emo_cat: batch_cat})
File "/Users/morpheus/.pyenv/versions/env3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 905, in run
run_metadata_ptr)
File "/Users/morpheus/.pyenv/versions/env3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1137, in _run
feed_dict_tensor, options, run_metadata)
File "/Users/morpheus/.pyenv/versions/env3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1355, in _do_run
options, run_metadata)
File "/Users/morpheus/.pyenv/versions/env3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1374, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: indices[1,0] = 1009 is not in [0, 1003)
[[Node: EmotionChattingMachine_1/EmotionChattingMachine_decoder/decoding/while/embedding_lookup = Gather[Tindices=DT_INT32, Tparams=DT_FLOAT, _class=["loc:@EmotionChattingMachine/concat"], validate_indices=true, _device="/job:localhost/replica:0/task:0/device:CPU:0"](EmotionChattingMachine_1/EmotionChattingMachine_decoder/decoding/while/embedding_lookup/Enter, EmotionChattingMachine_1/EmotionChattingMachine_decoder/decoding/while/mod)]]
Caused by op 'EmotionChattingMachine_1/EmotionChattingMachine_decoder/decoding/while/embedding_lookup', defined at:
File "infer_ECM.py", line 154, in
main(args)
File "infer_ECM.py", line 63, in main
beam_size, max_iter, attn_num_units, l2_regularize, name)
File "/Users/morpheus/Seq2seqAttnTF/utils.py", line 122, in compute_ECM_loss
name="%s_decoder" % name)
File "/Users/morpheus/Seq2seqAttnTF/model/decoder.py", line 204, in build_ECM_decoder
infer_outputs, _ = dynamic_decode(decoder_cell, max_iter)
File "/Users/morpheus/Seq2seqAttnTF/model/dymdecode.py", line 72, in dynamic_decode
back_prop=False)
File "/Users/morpheus/.pyenv/versions/env3/lib/python3.6/site-packages/tensorflow/python/ops/control_flow_ops.py", line 3096, in while_loop
result = loop_context.BuildLoop(cond, body, loop_vars, shape_invariants)
File "/Users/morpheus/.pyenv/versions/env3/lib/python3.6/site-packages/tensorflow/python/ops/control_flow_ops.py", line 2874, in BuildLoop
pred, body, original_loop_vars, loop_vars, shape_invariants)
File "/Users/morpheus/.pyenv/versions/env3/lib/python3.6/site-packages/tensorflow/python/ops/control_flow_ops.py", line 2814, in _BuildLoop
body_result = body(*packed_vars_for_body)
File "/Users/morpheus/Seq2seqAttnTF/model/dymdecode.py", line 50, in body
decode_finished)
File "/Users/morpheus/Seq2seqAttnTF/model/beamsearch.py", line 349, in step
new_inputs = tf.nn.embedding_lookup(self._embeddings, new_ids)
File "/Users/morpheus/.pyenv/versions/env3/lib/python3.6/site-packages/tensorflow/python/ops/embedding_ops.py", line 327, in embedding_lookup
transform_fn=None)
File "/Users/morpheus/.pyenv/versions/env3/lib/python3.6/site-packages/tensorflow/python/ops/embedding_ops.py", line 151, in _embedding_lookup_and_transform
result = _clip(_gather(params[0], ids, name=name), ids, max_norm)
File "/Users/morpheus/.pyenv/versions/env3/lib/python3.6/site-packages/tensorflow/python/ops/embedding_ops.py", line 55, in _gather
return array_ops.gather(params, ids, name=name)
File "/Users/morpheus/.pyenv/versions/env3/lib/python3.6/site-packages/tensorflow/python/ops/array_ops.py", line 2667, in gather
params, indices, validate_indices=validate_indices, name=name)
File "/Users/morpheus/.pyenv/versions/env3/lib/python3.6/site-packages/tensorflow/python/ops/gen_array_ops.py", line 1777, in gather
validate_indices=validate_indices, name=name)
File "/Users/morpheus/.pyenv/versions/env3/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "/Users/morpheus/.pyenv/versions/env3/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3271, in create_op
op_def=op_def)
File "/Users/morpheus/.pyenv/versions/env3/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1650, in init
self._traceback = self._graph._extract_stack() # pylint: disable=protected-access
InvalidArgumentError (see above for traceback): indices[1,0] = 1009 is not in [0, 1003)
[[Node: EmotionChattingMachine_1/EmotionChattingMachine_decoder/decoding/while/embedding_lookup = Gather[Tindices=DT_INT32, Tparams=DT_FLOAT, _class=["loc:@EmotionChattingMachine/concat"], validate_indices=true, _device="/job:localhost/replica:0/task:0/device:CPU:0"](EmotionChattingMachine_1/EmotionChattingMachine_decoder/decoding/while/embedding_lookup/Enter, EmotionChattingMachine_1/EmotionChattingMachine_decoder/decoding/while/mod)]]
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.