tensorflow / tensorflow/privacy
An op outside of the function building code is being passed a "Graph" tensor
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2k
- Forks
- 477
- Avg merge
- 22h 12m
- Merged PRs (30d)
- 1
Description
Hello, I'm trying to make a differentially private GAN, however when computing the gradients for my discriminator I get the error message
TypeError: An op outside of the function building code is being passed
a "Graph" tensor. It is possible to have Graph tensors
leak out of the function building context by including a
tf.init_scope in your function building code.
For example, the following function will fail:
@tf.function
def has_init_scope():
my_constant = tf.constant(1.)
with tf.init_scope():
added = my_constant * 2
The graph tensor has name: strided_slice:0
What's odd is that I can run the training step for the discriminator (computing the gradients) twice, however on the third iteration I get this error.
I have tried my code with TensorFlow 2.x and 1.x but I seem to be getting the same error on either.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No repository file or test is identified. Start by reducing the reported discriminator gradient computation to a reproducible Python/TensorFlow example, focusing on why the third iteration differs from the first two. Done means a minimal reproduction and an actionable diagnosis or fix, with regression coverage if the issue can be reproduced.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, tensorflow
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100