dennybritz / chatbot-retrieval

Dual LSTM Encoder for Dialog Response Generation
MIT License
1.58k stars 674 forks source link

ValueError: Only call `sigmoid_cross_entropy_with_logits` with named arguments (labels=..., logits=..., ...) #46

Open abhilash-reddy-k opened 7 years ago

abhilash-reddy-k commented 7 years ago

please help me with solving the ValueError, following are the error logs

abhilash@abhilash-Inspiron-N5010:~/Documents/chat bot/chatbot-retrieval-master$ python udc_train.py INFO:tensorflow:Using config: {'_model_dir': None, '_save_checkpoints_secs': 600, '_num_ps_replicas': 0, '_keep_checkpoint_max': 5, '_tf_random_seed': None, '_task_type': None, '_environment': 'local', '_is_chief': True, '_cluster_spec': <tensorflow.python.training.server_lib.ClusterSpec object at 0x7f6719eb9090>, '_tf_config': gpu_options { per_process_gpu_memory_fraction: 1.0 } , '_num_worker_replicas': 0, '_task_id': 0, '_save_summary_steps': 100, '_save_checkpoints_steps': None, '_evaluation_master': '', '_keep_checkpoint_every_n_hours': 10000, '_master': ''} WARNING:tensorflow:From /home/abhilash/.local/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/monitors.py:267: init (from tensorflow.contrib.learn.python.learn.monitors) is deprecated and will be removed after 2016-12-05. Instructions for updating: Monitors are deprecated. Please use tf.train.SessionRunHook. INFO:tensorflow:No glove/vocab path specificed, starting with random embeddings. Traceback (most recent call last): File "udc_train.py", line 64, in tf.app.run() File "/home/abhilash/.local/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 48, in run _sys.exit(main(_sys.argv[:1] + flags_passthrough)) File "udc_train.py", line 61, in main estimator.fit(input_fn=input_fn_train, steps=None, monitors=[eval_monitor]) File "/home/abhilash/.local/lib/python2.7/site-packages/tensorflow/python/util/deprecation.py", line 281, in new_func return func(*args, kwargs) File "/home/abhilash/.local/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 430, in fit loss = self._train_model(input_fn=input_fn, hooks=hooks) File "/home/abhilash/.local/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 927, in _train_model model_fn_ops = self._get_train_ops(features, labels) File "/home/abhilash/.local/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 1132, in _get_train_ops return self._call_model_fn(features, labels, model_fn_lib.ModeKeys.TRAIN) File "/home/abhilash/.local/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 1103, in _call_model_fn model_fn_results = self._model_fn(features, labels, kwargs) File "/home/abhilash/Documents/chat bot/chatbot-retrieval-master/udc_model.py", line 39, in model_fn targets) File "/home/abhilash/Documents/chat bot/chatbot-retrieval-master/models/dual_encoder.py", line 81, in dual_encoder_model losses = tf.nn.sigmoid_cross_entropy_with_logits(logits, tf.to_float(targets)) File "/home/abhilash/.local/lib/python2.7/site-packages/tensorflow/python/ops/nn_impl.py", line 147, in sigmoid_cross_entropy_with_logits _sentinel, labels, logits) File "/home/abhilash/.local/lib/python2.7/site-packages/tensorflow/python/ops/nn_ops.py", line 1562, in _ensure_xent_args "named arguments (labels=..., logits=..., ...)" % name) ValueError: Only call sigmoid_cross_entropy_with_logits with named arguments (labels=..., logits=..., ...)

yogesh-0586 commented 7 years ago

Changed line number 81 in dual_encoder.py with following losses = tf.nn.sigmoid_cross_entropy_with_logits(logits=logits, labels=tf.to_float(targets))

add logits= and labels=