Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

sigmoid_cross_entropy_with_logits does not have `labels` arg

See original GitHub issue


I’m having some difficulties getting the example code to execute. I believe the issue stems from a tensorflow versioning delta. I first tried to train a model on the celebA data after setting up a cpu tensorflow docker container from:

When I run

python --dataset celebA --input_height=108 --is_train --is_crop True

I get the following traceback:

Traceback (most recent call last):
  File "", line 96, in <module>
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/", line 43, in run
    sys.exit(main(sys.argv[:1] + flags_passthrough))
  File "", line 76, in main
  File "/root/git_repos/DCGAN-tensorflow/", line 71, in __init__
  File "/root/git_repos/DCGAN-tensorflow/", line 115, in build_model
    logits=self.D_logits, labels=tf.ones_like(self.D)))
TypeError: sigmoid_cross_entropy_with_logits() got an unexpected keyword argument 'labels'

After looking, I found sigmoid_cross_entropy_with_logits here: which shows that it does take a labels arg. However, the version under v0.12.1 does not take this arg which I believe is the error I’m receiving above.

Furthermore, if I try to install the specific version of tensorflow branch that you linked to:

pip install git+

I get the following traceback:

Collecting git+
  Cloning (to r0.12) to /tmp/pip-oKC0L1-build
    Complete output from command python egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    IOError: [Errno 2] No such file or directory: '/tmp/pip-oKC0L1-build/'

Command "python egg_info" failed with error code 1 in /tmp/pip-oKC0L1-build/

Any suggestions on how to get this up and running?

Thanks, Scott

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

carpedm20commented, Feb 6, 2017

You can use any links in like:

pip install -U,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON2,label=gpu-linux/lastSuccessfulBuild/artifact/pip_test/whl/tensorflow_gpu-1.0.0rc1-cp27-none-linux_x86_64.whl
ppwwyyxxcommented, Jan 17, 2017

Yes the argument only exist in new version of TensorFlow.

Your command is not the right way to install TensorFlow. Please refer to the documentation: . (For this new feature you may need the nightly build)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Only call `sigmoid_cross_entropy_with_logits` with named ...
I have just build my first model using Phyton, Keras and Tensorflow. My model looks like this:
Read more >
Measures the probability error in tasks with two outcomes in which each outcome is independent and need not have a fully certain label....
Read more >
tf.nn.sigmoid_cross_entropy_with_logits | TensorFlow
A Tensor of the same shape as logits with the componentwise logistic losses. Raises: ValueError : If logits and labels do not have...
Read more >
Python Examples of tensorflow.python.ops.nn. ...
A common use case is to have logits of shape `[batch_size, num_classes]` and labels of shape `[batch_size]`. But higher dimensions are supported. Args:...
Read more >
Should the cost function be zero using TensorFlow's ...
I'm building a CNN to make a binary classification (1 or zero). For this, I'm using the cost function sigmoid_cross_entropy_with_logits . But ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found