neural_collaborative_filtering icon indicating copy to clipboard operation
neural_collaborative_filtering copied to clipboard

while executing GMF.py

Open mushahrukhkhan opened this issue 6 years ago • 5 comments

Hello,

I am getting this error while error GMF.Py kindly guide me....

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

mushahrukhkhan avatar Mar 26 '18 08:03 mushahrukhkhan

Hi!

Got the same error. If someone could provide some help, I will really appreciate

NickShatalov avatar Aug 15 '18 16:08 NickShatalov

This seems to be an API discrepancy. Please check how is the use of the API in your Tensorflow/Theano version.

On Thu, Aug 16, 2018 at 12:03 AM, NickShatalov [email protected] wrote:

Hi!

Got the same error. If someone could provide some help, I will really appreciate

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/hexiangnan/neural_collaborative_filtering/issues/15#issuecomment-413244949, or mute the thread https://github.com/notifications/unsubscribe-auth/ABGxjtVgz2BRGPudkwMTyxdUUEjGvR_Tks5uREY9gaJpZM4S6vUn .

hexiangnan avatar Aug 15 '18 16:08 hexiangnan

Yes, this error was due to conflict of versions.

I had

  • Keras 1.0.7
  • Theano 0.8.2
  • Tensorflow 1.9.0

In /home/user/anaconda3/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py I changed:

  • tf.nn.sigmoid_cross_entropy_with_logits(output, target) to tf.nn.sigmoid_cross_entropy_with_logits(logits=output, labels=target),
  • added from tensorflow.python import control_flow_ops as flow_ops with using flow_ops.cond(...) instead of tensorflow.python.control_flow_ops.cond(...)

Also I changed some old constructions in GMF.py:

  • changed xramge to range
  • changed train.has_key((u, j)) to (u, j) in train

After that model finally started to train

NickShatalov avatar Aug 15 '18 17:08 NickShatalov

This pull-request fixes the problems.

rishj97 avatar Feb 21 '19 22:02 rishj97

Yes, this error was due to conflict of versions.

I had

  • Keras 1.0.7
  • Theano 0.8.2
  • Tensorflow 1.9.0

In /home/user/anaconda3/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py I changed:

  • tf.nn.sigmoid_cross_entropy_with_logits(output, target) to tf.nn.sigmoid_cross_entropy_with_logits(logits=output, labels=target),
  • added from tensorflow.python import control_flow_ops as flow_ops with using flow_ops.cond(...) instead of tensorflow.python.control_flow_ops.cond(...)

Also I changed some old constructions in GMF.py:

  • changed xramge to range
  • changed train.has_key((u, j)) to (u, j) in train

After that model finally started to train

Thank U so much! I had fixed it

Fanshaoliu avatar Apr 27 '20 07:04 Fanshaoliu