Git Product home page Git Product logo

easy_seq2seq's People

Contributors

j-min avatar judelee19 avatar mcscholtz avatar naveenprasanth avatar suriyadeepan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

easy_seq2seq's Issues

Question about training time

How long should it take to train on a CPU? I'm using a MacBook Air with a 1.3 GHz Intel Core i5 processor and 4 GB 1600 MHz DDR3 of memory.

Perplexity issue

Even though I didn't edit the code when I apporach to training step 13800 than each bucket perplexity is so high like below.

global step 13800 learning rate 0.4851 step-time 0.18 perplexity 1.01
eval: bucket 0 perplexity 8992400.69
eval: bucket 1 perplexity 23779421.72
eval: bucket 2 perplexity 100536278.99
eval: bucket 3 perplexity 48283674.77

Is it something wrong ? or should I consider it as a overfiting?

Did anyone know which version of tensorflow I should use?

Hello, may i ask you which version you've used in this project? can you share your requirements.txt file?

i have tried different version of tensorflow it still not working, always this problem, i'm working on a project and i saw this, but every time when i trying to use my own dataset to training it, always missing some patches.

Issues after 16200 steps

Not sure if it hardware related, settings related or not, previously trained on CPU but now trained on a GTX 750 TI, gets to 16200 steps then Ubuntu raises error, after the initial happening of this, I deleted all data and checkpoints and started again twice but still persists, error log of event is as follows, everytime at 16200 steps:

^CTraceback (most recent call last):
  File "execute.py", line 319, in <module>
    train()
  File "execute.py", line 187, in train
    model.saver.save(sess, checkpoint_path, global_step=model.global_step)
  File "/home/tinn/.local/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 1335, in save
    self.export_meta_graph(meta_graph_filename)
  File "/home/tinn/.local/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 1368, in export_meta_graph
    clear_devices=clear_devices)
  File "/home/tinn/.local/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 1590, in export_meta_graph
    **kwargs)
  File "/home/tinn/.local/lib/python2.7/site-packages/tensorflow/python/framework/meta_graph.py", line 651, in export_scoped_meta_graph
    as_text=as_text)
  File "/home/tinn/.local/lib/python2.7/site-packages/tensorflow/python/training/training_util.py", line 148, in write_graph
    file_io.atomic_write_string_to_file(path, graph_def.SerializeToString())
  File "/home/tinn/.local/lib/python2.7/site-packages/google/protobuf/internal/python_message.py", line 1060, in SerializeToString
    return self.SerializePartialToString()
  File "/home/tinn/.local/lib/python2.7/site-packages/google/protobuf/internal/python_message.py", line 1069, in SerializePartialToString
    self._InternalSerialize(out.write)
  File "/home/tinn/.local/lib/python2.7/site-packages/google/protobuf/internal/python_message.py", line 1075, in InternalSerialize
    field_descriptor._encoder(write_bytes, field_value)
  File "/home/tinn/.local/lib/python2.7/site-packages/google/protobuf/internal/encoder.py", line 762, in EncodeField
    local_EncodeVarint(write, value.ByteSize())
  File "/home/tinn/.local/lib/python2.7/site-packages/google/protobuf/internal/python_message.py", line 1037, in ByteSize
    size += field_descriptor._sizer(field_value)
  File "/home/tinn/.local/lib/python2.7/site-packages/google/protobuf/internal/encoder.py", line 302, in RepeatedFieldSize
    l = element.ByteSize()
  File "/home/tinn/.local/lib/python2.7/site-packages/google/protobuf/internal/python_message.py", line 1037, in ByteSize
    size += field_descriptor._sizer(field_value)
  File "/home/tinn/.local/lib/python2.7/site-packages/google/protobuf/internal/encoder.py", line 247, in FieldSize
    l = local_len(value.encode('utf-8'))

After this training cannot continue and the UI will no longer boot up.

TypeError in execute.py

Preparing data in working_dir/
Creating 3 layers of 256 units.
Traceback (most recent call last):
File "execute.py", line 300, in
train()
File "execute.py", line 123, in train
model = create_model(sess, False)
File "execute.py", line 95, in create_model
model = seq2seq_model.Seq2SeqModel( gConfig['enc_vocab_size'], gConfig['dec_vocab_size'], _buckets, gConfig['layer_size'], gConfig['num_layers'], gConfig['max_gradient_norm'], gConfig['batch_size'], gConfig['learning_rate'], gConfig['learning_rate_decay_factor'], forward_only=forward_only)
File "/home/localhost/test_case_1/seq2seq_model.py", line 167, in init
self.saver = tf.train.Saver(tf.initialize_all_variables())
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/training/saver.py", line 986, in init
self.build()
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/training/saver.py", line 1015, in build
restore_sequentially=self._restore_sequentially)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/training/saver.py", line 602, in build
saveables = self._ValidateAndSliceInputs(names_to_saveables)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/training/saver.py", line 498, in _ValidateAndSliceInputs
names_to_saveables = BaseSaverBuilder.OpListToDict(names_to_saveables)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/training/saver.py", line 453, in OpListToDict
"list: %s" % op_list)
TypeError: Variables to save should be passed in a dict or a list: name: "init"
op: "NoOp"
input: "^init/NoOp"
input: "^init/NoOp_1"

TypeCasting issue when running execute.py in train mode

File "/home/raghav/development/machineLearning/tensorflow/_python_build/tensorflow/python/framework/op_def_library.py", line 522, in apply_op
inferred_from[input_arg.type_attr]))
TypeError: Input 'y' of 'Mul' Op has type float32 that does not match type int32 of argument 'x'.

Unable to train the model due to " Variable proj_w already exists, disallowed. " error

After training the model for around 108300 training cycles I interrupted the training and started the testing process. As per the instructions provided I replaced mode= test in seq2seq.ini file and executed the execute.py program. The testing process exited with the error trace.

File "<ipython-input-37-8375f4779982>", line 1, in <module>
   runfile('D:/Rights_workspace/Kaggle/ChatBOT1/execute.py', wdir='D:/Rights_workspace/Kaggle/ChatBOT1')

 File "D:\Anaconda32\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 714, in runfile
   execfile(filename, namespace)

 File "D:\Anaconda32\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 89, in execfile
   exec(compile(f.read(), filename, 'exec'), namespace)

 File "D:/Rights_workspace/Kaggle/ChatBOT1/execute.py", line 308, in <module>
   decode()

 File "D:/Rights_workspace/Kaggle/ChatBOT1/execute.py", line 197, in decode
   model = create_model(sess, True)

 File "D:/Rights_workspace/Kaggle/ChatBOT1/execute.py", line 100, in create_model
   model = seq2seq_model.Seq2SeqModel( gConfig['enc_vocab_size'], gConfig['dec_vocab_size'], _buckets, gConfig['layer_size'], gConfig['num_layers'], gConfig['max_gradient_norm'], gConfig['batch_size'], gConfig['learning_rate'], gConfig['learning_rate_decay_factor'], forward_only=forward_only)

 File "D:\Rights_workspace\Kaggle\ChatBOT1\seq2seq_model.py", line 91, in __init__
   w = tf.get_variable("proj_w", [size, self.target_vocab_size])

 File "D:\Anaconda32\lib\site-packages\tensorflow\python\ops\variable_scope.py", line 1024, in get_variable
   custom_getter=custom_getter)

 File "D:\Anaconda32\lib\site-packages\tensorflow\python\ops\variable_scope.py", line 850, in get_variable
   custom_getter=custom_getter)

 File "D:\Anaconda32\lib\site-packages\tensorflow\python\ops\variable_scope.py", line 346, in get_variable
   validate_shape=validate_shape)

 File "D:\Anaconda32\lib\site-packages\tensorflow\python\ops\variable_scope.py", line 331, in _true_getter
   caching_device=caching_device, validate_shape=validate_shape)

 File "D:\Anaconda32\lib\site-packages\tensorflow\python\ops\variable_scope.py", line 632, in _get_single_variable
   name, "".join(traceback.format_list(tb))))

ValueError: Variable proj_w already exists, disallowed. Did you mean to set reuse=True in VarScope? Originally defined at:

 File "D:\Anaconda32\lib\site-packages\tensorflow\python\framework\ops.py", line 1128, in __init__
   self._traceback = _extract_stack()
 File "D:\Anaconda32\lib\site-packages\tensorflow\python\framework\ops.py", line 2240, in create_op
   original_op=self._default_original_op, op_def=op_def)
 File "D:\Anaconda32\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 759, in apply_op
   op_def=op_def)

I am not sure how to go about this error. Kindly help !

Problem No module named models.rnn.translate

python execute.py

Traceback (most recent call last):
File "execute.py", line 31, in
import seq2seq_model
tensorflow/seq2seq_model.py", line 28, in
from tensorflow.models.rnn.translate import data_utils
ImportError: No module named models.rnn.translate

How can i solve it?

This is my version of tensorflow:
Name: tensorflow
Version: 1.1.0
Summary: TensorFlow helps the tensors flow
Home-page: http://tensorflow.org/
Author: Google Inc.
Author-email: [email protected]
License: Apache 2.0
Location: /usr/local/lib/python2.7/dist-packages
Requires: mock, numpy, wheel, six, protobuf, werkzeug

Python Version
Python 2.7.12

TensorFlow checkpointing V2 bug

The new checkpoint saving system for TF seems to have caused an issue with this code. Now at every checkpoint 3 files are created i.e.:

- seq2seq.ckpt-300.data-00000-of-00001
- seq2seq.ckpt-300.index
- seq2seq.ckpt-300.meta

Training seems to progress normally with no errors but when I pause training and try to resume or test from the last checkpoint, a model with fresh parameters is created and my training is rendered useless.

Temporary workaround:
In seq2seq_model.py initialize self.saver = tf.train.Saver(tf.global_variables(), write_version=1) to revert back to the deprecated version to fix the problem. It will give a warning message about using the old version. But now I see that only two files are created at each checkpoint i.e.:

- seq2seq.ckpt-300
- seq2seq.ckpt-300.meta

Obviously this would suggest something is going on with the new write version...any ideas? I am wondering if it has something to do with the checkpoint file path in execute.py at the line: model.saver.save(sess, checkpoint_path, global_step=model.global_step)

UPDATE:
The problem is referenced and solved here: http://stackoverflow.com/questions/40469553/tensorflow-loading-model-with-saver-v2

Unicode Error

This is the error i get when i try to train the model
UnicodeDecodeError: 'ascii' codec can't decode byte 0x97 in position 4: ordinal not in range(128)

pretrained model

@suriyadeepan thanks for making this public. do you plan on releasing pretrained model (that is, trained on the cornell movie dialogue corpus)?

Bucket perplexities increasing while global perplexity decreases

I have been running this code for about 24 hours (~100,000 steps) with default parameters and it reports the global perplexity to be reasonably good now (<6). However, each of the four bucket perplexities have been rising consistently and are now very high (>10,000). What is the problem? Is this normal?

typo in seq2seq.ini ?

question about the definitions of the train/test files in seq2seq.ini.

Is there a reason that both test_enc & test_dec are set to data/test.enc? I'm assuming that test_dec should be set to data/test.dec. Is this assumption correct? If my assumption is not correct could someone please explain to the logic as to why test.enc is used twice here?

Thanks

[lines 4-7 of seq2seq.ini]

train_enc = data/train.enc
train_dec = data/train.dec
test_enc = data/test.enc
test_dec = data/test.enc

Training data issue

While I try to execute the "execute.py" to train the data, following error displays, can you please help me resolve this:

Traceback (most recent call last):
File "C:\Users\gssjekum\AppData\Local\Programs\Python\Python35\Scripts\easy_seq2seq\execute.py", line 300, in
train()
File "C:\Users\gssjekum\AppData\Local\Programs\Python\Python35\Scripts\easy_seq2seq\execute.py", line 114, in train
enc_train, dec_train, enc_dev, dec_dev, _, _ = data_utils.prepare_custom_data(gConfig['working_directory'],gConfig['train_enc'],gConfig['train_dec'],gConfig['test_enc'],gConfig['test_dec'],gConfig['enc_vocab_size'],gConfig['dec_vocab_size'])
File "C:\Users\gssjekum\AppData\Local\Programs\Python\Python35\Scripts\easy_seq2seq\data_utils.py", line 137, in prepare_custom_data
data_to_token_ids(train_enc, enc_train_ids_path, enc_vocab_path, tokenizer)
File "C:\Users\gssjekum\AppData\Local\Programs\Python\Python35\Scripts\easy_seq2seq\data_utils.py", line 112, in data_to_token_ids
vocab, _ = initialize_vocabulary(vocabulary_path)
File "C:\Users\gssjekum\AppData\Local\Programs\Python\Python35\Scripts\easy_seq2seq\data_utils.py", line 87, in initialize_vocabulary
rev_vocab.extend(f.readlines())
File "C:\Users\gssjekum\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 131, in readlines
s = self.readline()
File "C:\Users\gssjekum\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 124, in readline
return compat.as_str_any(self._read_buf.ReadLineAsString())
File "C:\Users\gssjekum\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\util\compat.py", line 106, in as_str_any
return as_str(value)
File "C:\Users\gssjekum\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\util\compat.py", line 84, in as_text
return bytes_or_text.decode(encoding)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x92 in position 1: invalid start byte

unknown value error

when i try testing or training it gives this error

type(cell).name))
ValueError: Attempt to reuse RNNCell <tensorflow.contrib.rnn.python.ops.core_rnn_cell_impl.GRUCell object at 0x000001C2970F7358> with a different variable scope than its first use. First use of cell was with scope 'embedding_attention_seq2seq/embedding_attention_decoder/attention_decoder/multi_rnn_cell/cell_0/gru_cell', this attempt is with scope 'embedding_attention_seq2seq/rnn/multi_rnn_cell/cell_0/gru_cell'. Please create a new instance of the cell if you would like it to use a different set of weights. If before you were using: MultiRNNCell([GRUCell(...)] * num_layers), change to: MultiRNNCell([GRUCell(...) for _ in range(num_layers)]). If before you were using the same cell instance as both the forward and reverse cell of a bidirectional RNN, simply create two instances (one for forward, one for reverse). In May 2017, we will start transitioning this cell's behavior to use existing stored weights, if any, when it is called with scope=None (which can lead to silent model degradation, so this error will remain until then.)

is there any solution

Using Anaconda + Tensorflow + Python 3.5 config error

I am using the above configuration on an Ubuntu Linux install and am getting the following error:
Traceback (most recent call last):
File "execute.py", line 33, in
from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'

I have six and configparser installed... and am at a loss as to what I am doing wrong.

IndexError: list index out of range

After trained enough, I run with "test" and input someting. But get Error.

hello
Traceback (most recent call last):
File "E:/A Files/chatbot-master/execute.py", line 324, in
decode()
File "E:/A Files/chatbot-master/execute.py", line 245, in decode
print(" ".join([tf.compat.as_str(rev_dec_vocab[output]) for output in outputs]))
File "E:/A Files/chatbot-master/execute.py", line 245, in
print(" ".join([tf.compat.as_str(rev_dec_vocab[output]) for output in outputs]))
IndexError: list index out of range

Replies with _UNK.

A lot of the time when I talk to the model it replies with simply _UNK. Especially for quite short queries. When I train with my own larger corpus it does this a lot more than with the movie corpus although it still happens with that.
screen shot 2016-09-23 at 1 24 51 pm

I'm wondering if this is because I just haven't trained the model long enough, or perhaps am not processing my own corpus properly.

I've tried some different layer sizes, and number of layers too.

how to run python3 execute.py successful for tf1.4?

hi,
i install tf1.4 on my mac, run easy_seq2seq demo, and it failed.
anyone can help me make it run fine, thanks.

macbookpro:easy_seq2seq fredlee$ python3 execute.py
/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/importlib/_bootstrap.py:205: RuntimeWarning: compiletime version 3.5 of module 'tensorflow.python.framework.fast_tensor_util' does not match runtime version 3.6
return f(*args, **kwds)
Traceback (most recent call last):
File "execute.py", line 31, in
import seq2seq_model
File "/Users/fredlee/Downloads/tensorflow/study/easy_seq2seq/seq2seq_model.py", line 28, in
from tensorflow.models.rnn.translate import data_utils
ModuleNotFoundError: No module named 'tensorflow.models'

InvalidArgumentError

InvalidArgumentError (see above for traceback): Received a label value of 15328 which is outside the valid range of [0, 256). Label values: 84 60 82 128 79 7 3 60 10401 7 83 232 296 20 190 1278 7 3423 3 7 301 47 1949 69 7 8773 7 2818 104 56 1214 117 78 255 20 7 394 185 115 234 2106 4 9967 15328 10540 185 2914 56 20 127 82 4936 47 83 1809 1866 7 1182 7 47 906 33 7 69
[[Node: model_with_buckets/sequence_loss_3/sequence_loss_by_example/SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits = SparseSoftmaxCrossEntropyWithLogits[T=DT_FLOAT, Tlabels=DT_INT32, _device="/job:localhost/replica:0/task:0/device:CPU:0"](model_with_buckets/embedding_attention_seq2seq_3/embedding_attention_decoder/attention_decoder/AttnOutputProjection/BiasAdd, model_with_buckets/sequence_loss_3/sequence_loss_by_example/Reshape)]]

This is the InvalidArgumentError Exception due to line no. 224 ( outputs = session.run(output_feed, input_feed)) in seq2seq_model.py
type(output_feed)=list
type(input_feed)=dict

ValueError: Shape must be rank 2 but is rank 1

when i use python 3.6 ,and tensorflow 1.0. execute python execute.py, i encounter the bellow prolem.
can you help me to find out the reason?

File "/home/wel/deeplearning/easybot/seq2seq_model.py", line 93, in sampled_loss
self.target_vocab_size)
File "/home/wel/.pyenv/versions/3.6.0/lib/python3.6/site-packages/tensorflow/python/ops/nn_impl.py", line 1191, in sampled_softmax_loss
name=name)
File "/home/wel/.pyenv/versions/3.6.0/lib/python3.6/site-packages/tensorflow/python/ops/nn_impl.py", line 947, in _compute_sampled_logits
range_max=num_classes)
File "/home/wel/.pyenv/versions/3.6.0/lib/python3.6/site-packages/tensorflow/python/ops/candidate_sampling_ops.py", line 134, in log_uniform_candidate_sampler
seed2=seed2, name=name)
File "/home/wel/.pyenv/versions/3.6.0/lib/python3.6/site-packages/tensorflow/python/ops/gen_candidate_sampling_ops.py", line 357, in _log_uniform_candidate_sampler
name=name)
File "/home/wel/.pyenv/versions/3.6.0/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 763, in apply_op
op_def=op_def)
File "/home/wel/.pyenv/versions/3.6.0/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 2397, in create_op
set_shapes_for_outputs(ret)
File "/home/wel/.pyenv/versions/3.6.0/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1757, in set_shapes_for_outputs
shapes = shape_func(op)
File "/home/wel/.pyenv/versions/3.6.0/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1707, in call_with_requiring
return call_cpp_shape_fn(op, require_shape_fn=True)
File "/home/wel/.pyenv/versions/3.6.0/lib/python3.6/site-packages/tensorflow/python/framework/common_shapes.py", line 610, in call_cpp_shape_fn
debug_python_shape_fn, require_shape_fn)
File "/home/wel/.pyenv/versions/3.6.0/lib/python3.6/site-packages/tensorflow/python/framework/common_shapes.py", line 675, in _call_cpp_shape_fn_impl
raise ValueError(err.message)
ValueError: Shape must be rank 2 but is rank 1 for 'model_with_buckets/sequence_loss/sequence_loss_by_example/sampled_softmax_loss/LogUniformCandidateSampler' (op: 'LogUniformCandidateSampler') with input shapes: [?].

Running execute.py

Got this error when running execute.py

Traceback (most recent call last):
File "execute.py", line 300, in
train()
File "execute.py", line 123, in train
model = create_model(sess, False)
File "execute.py", line 95, in create_model
model = seq2seq_model.Seq2SeqModel( gConfig['enc_vocab_size'], gConfig['dec_vocab_size'], _buckets, gConfig['layer_size'], gConfig['num_layers'], gConfig['max_gradient_norm'], gConfig['batch_size'], gConfig['learning_rate'], gConfig['learning_rate_decay_factor'], forward_only=forward_only)
File "/home/ubuntu/abbey_modupe/easy_seq2seq-master/seq2seq_model.py", line 166, in init
self.saver = tf.train.Saver(tf.global_variables())
AttributeError: 'module' object has no attribute 'global_variables'

Did anyone witness this?

[Question] Its ok to replace train/test.enc/dec with a new dataset?

I still have a few questions about this module,

  • Whats the correct way to know if the bot has finished learning the train.enc/dec? global perplexity near 0? or i should worry about bucket perplexity also?
  • After i finished training one train.enc/dec its ok to replace it with a new one? I should worry that it will recreate the vocab or something like that?

Thanks again for making this module!

encoder_inputs

Traceback (most recent call last):

File "/home/mauajama-firdaus/seq_dac1.py", line 82, in generate_single_output
encoder_state2 = tf.concat([e_n, state1], 1)
File "/home/mauajama-firdaus/anaconda2/lib/python2.7/site-packages/tensorflow/python/ops/array_ops.py", line 1099, in concat
return gen_array_ops._concat_v2(values=values, axis=axis, name=name)
File "/home/mauajama-firdaus/anaconda2/lib/python2.7/site-packages/tensorflow/python/ops/gen_array_ops.py", line 706, in _concat_v2
"ConcatV2", values=values, axis=axis, name=name)
File "/home/mauajama-firdaus/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "/home/mauajama-firdaus/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2958, in create_op
set_shapes_for_outputs(ret)
File "/home/mauajama-firdaus/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2209, in set_shapes_for_outputs
shapes = shape_func(op)
File "/home/mauajama-firdaus/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2159, in call_with_requiring
return call_cpp_shape_fn(op, require_shape_fn=True)
File "/home/mauajama-firdaus/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/common_shapes.py", line 627, in call_cpp_shape_fn
require_shape_fn)
File "/home/mauajama-firdaus/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/common_shapes.py", line 691, in _call_cpp_shape_fn_impl
raise ValueError(err.message)
ValueError: Shape must be rank 0 but is rank 2 for 'model/concat' (op: 'ConcatV2') with input shapes: [], [?,512], []

model test problem

I train the mode about 17100 steps. It returns this below,When I run execute.py to test. I don`t know why? Thanks!

Reading model parameters from working_dir/seq2seq.ckpt-17100

hi

It shows this below, when I hit this url.

AccessDenied
Access Denied
BD430F377E770943

q8Bx9qUM45WGwFJrhAtiZurgFfEPeBH0ioeyLQud8Q884T8kXY4OdLkA+icXM9ES2UBSEhF5Wso=

UnicodeDecodeError: 'utf8' codec can't decode byte 0x96 in position 1: invalid start byte

martin@ubuntu:~/Downloads/easy_seq2seq-master$ python execute.py

>> Mode : train

Preparing data in working_dir/
Tokenizing data in data/test.enc
Traceback (most recent call last):
  File "execute.py", line 303, in <module>
    train()
  File "execute.py", line 117, in train
    enc_train, dec_train, enc_dev, dec_dev, _, _ = data_utils.prepare_custom_data(gConfig['working_directory'],gConfig['train_enc'],gConfig['train_dec'],gConfig['test_enc'],gConfig['test_dec'],gConfig['enc_vocab_size'],gConfig['dec_vocab_size'])
  File "/home/martin/Downloads/easy_seq2seq-master/data_utils.py", line 147, in prepare_custom_data
    data_to_token_ids(test_enc, enc_dev_ids_path, enc_vocab_path, tokenizer)
  File "/home/martin/Downloads/easy_seq2seq-master/data_utils.py", line 125, in data_to_token_ids
    normalize_digits)
  File "/home/martin/Downloads/easy_seq2seq-master/data_utils.py", line 104, in sentence_to_token_ids
    words = basic_tokenizer(sentence)
  File "/home/martin/Downloads/easy_seq2seq-master/data_utils.py", line 51, in basic_tokenizer
    word = str.encode(space_separated_fragment)
  File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0x96 in position 1: invalid start byte

then i change from python 2.7 to python3

martin@ubuntu:~/Downloads/easy_seq2seq-master$ python3 execute.py

Mode : train

Preparing data in working_dir/
Tokenizing data in data/test.dec
Creating 3 layers of 256 units.
WARNING:tensorflow:At least two cells provided to MultiRNNCell are the same object and will share weights.
Traceback (most recent call last):
File "execute.py", line 301, in
train()
File "execute.py", line 124, in train
model = create_model(sess, False)
File "execute.py", line 96, in create_model
model = seq2seq_model.Seq2SeqModel( gConfig['enc_vocab_size'], gConfig['dec_vocab_size'], _buckets, gConfig['layer_size'], gConfig['num_layers'], gConfig['max_gradient_norm'], gConfig['batch_size'], gConfig['learning_rate'], gConfig['learning_rate_decay_factor'], forward_only=forward_only)
File "/home/martin/Downloads/easy_seq2seq-master/seq2seq_model.py", line 147, in init
self.outputs, self.losses = tf.nn.seq2seq.model_with_buckets(
AttributeError: module 'tensorflow.nn' has no attribute 'seq2seq'

Model Architectures

Just curious, what model architectures have you experimented with?

I tried a 3-layer LSTM with 256 nodes, and noticed that as the global perplexity fell below 5, the individual bucket perplexities spiked up above 100 (overfitting?)

When playing with the decoder, I noticed the results were really non-sensical. Any ideas?

I'm now experimenting with a 4-layer LSTM with 1024 nodes...

ValueError: invalid literal for int() with base 10: '\ufeff219'

Initially, I had the error of
UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in position 0: ordinal not in range(128)
That was solved when I converted all the downloaded files in data to utf-8.

Now, while at the beginning of the training the error
UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in position 0: ordinal not in range(128)
is being displayed.

Not sure about the reason.
Could anybody help?

Wrong when implementing given attention example

Hello,

When I implemented the example given from readme,
model = AttentionSeq2Seq(input_dim=5, input_length=7, hidden_dim=10, output_length=8, output_dim=20, depth=4)
It outputs wrong message as following
ValueError: Shape must be rank 2 but is rank 3 for 'MatMul_17' (op: 'MatMul') with input shapes: [?,?], [?,?,10].

My keras version is 1.2.2, tensorflow version is 1.0.0, is there anyone who met the same problem?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.