Hi guys. I am new to tensorflow and just trying out couples of examples.
I am using Tensorflow 1.0.1 and python 2.7 w anaconda.
I think it's because of the function relocations, there are couples of issue happens, when I am running the train section.
.
.
.
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: [?].
Not sure the should I change the input or what, anyone have some clues?
Thanks a lot.
===================================================
Update #1
Turn out I have sort this one out , but I encounter another one, seems something wrong with model_with_buckets()
Here I list all the change I made.
- In seq2seq2.py
i) from tensorflow.models.rnn.translate import data_utils change -> import data_utils
ii) nn.rnn_cell change -> contrib.rnn
iii) nn.seq2seq change -> contrib.legacy_seq2seq
iv) fixing ValueError , interchange "label" and "input"
In tf 0.12.0: Definition : tf.nn.sampled_softmax_loss(weights, biases, inputs, labels, num_sampled, num_classes, num_true=1, sampled_values=None, remove_accidental_hits=True, partition_strategy="mod", name="sampled_softmax_loss")
In tf 1.0: tf.nn.sampled_softmax_loss(weights, biases, labels, inputs, num_sampled, num_classes, num_true=1, sampled_values=None, remove_accidental_hits=True, partition_strategy='mod', name='sampled_softmax_loss')
- For missing train.enc error, check data/ exists or not
New Error:
File "/Users/ATC/Desktop/TensorFlow/6. Chatbot/seq2seq_model.py", line 149, in init
softmax_loss_function=softmax_loss_function)
TypeError: Input 'y' of 'Mul' Op has type float32 that does not match type int32 of argument 'x'.