Skip to content

sampled_loss() got an unexpected keyword argument 'logits' #1736

@athuldevin

Description

@athuldevin

I am using tesorflow version 1.2 (gpu)
i try to run tensorflow chatbot which is a varient of translate example . fixed many problems due to version change ,but can't fix this error

Traceback (most recent call last): File "C:\Users\win-7\Downloads\tensorflow_chatbot-master\new\execute.py", line 319, in <module> train() File "C:\Users\win-7\Downloads\tensorflow_chatbot-master\new\execute.py", line 137, in train model = create_model(sess, False) File "C:\Users\win-7\Downloads\tensorflow_chatbot-master\new\execute.py", line 104, 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 "C:\Users\win-7\Downloads\tensorflow_chatbot-master\new\seq2seq_model.py", line 150, in __init__ softmax_loss_function=softmax_loss_function) File "C:\Python35\lib\site-packages\tensorflow\contrib\legacy_seq2seq\python\ops\seq2seq.py", line 1221, in model_with_buckets softmax_loss_function=softmax_loss_function)) File "C:\Python35\lib\site-packages\tensorflow\contrib\legacy_seq2seq\python\ops\seq2seq.py", line 1134, in sequence_loss softmax_loss_function=softmax_loss_function)) File "C:\Python35\lib\site-packages\tensorflow\contrib\legacy_seq2seq\python\ops\seq2seq.py", line 1089, in sequence_loss_by_example crossent = softmax_loss_function(labels=target, logits=logit) TypeError: sampled_loss() got an unexpected keyword argument 'logits'

error causing line of code
self.outputs, self.losses = tf.contrib.legacy_seq2seq.model_with_buckets( self.encoder_inputs, self.decoder_inputs, targets, self.target_weights, buckets, lambda x, y: seq2seq_f(x, y, False), softmax_loss_function=softmax_loss_function) <-- line 150 from seq2seq.py

and softmax_loss_function is come from here

def sampled_loss(inputs, labels): labels = tf.reshape(labels, [-1, 1]) return tf.nn.sampled_softmax_loss(w_t, b, labels, inputs, num_samples, self.target_vocab_size) softmax_loss_function = sampled_loss

please help

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions