Comments (5)
Its running perfectly :), thank you so much
from generative-adversarial-networks.
First, try restarting the kernel, and running the notebook again. A lot of times creating Tensorflow graphs in iPython notebooks can get a little messy.
If that doesn't fix it, this is most likely an issue with scope. I think that the new Tensorflow version deals with optimizers (other than GradientDescentOptimizer) a bit differently. I think adding this with tf.variable_scope(tf.get_variable_scope(), reuse=False):
before the declaration of the Adam optimizer should fix the problem, but not completely sure if this is a long term solution. Have you come across this error @jonbruner
from generative-adversarial-networks.
Adit is correct; this is usually a scope issue. When the Adam optimizer is instantiated, it creates a bunch of additional TensorFlow operations, and if TF thinks it can only reuse existing operations it throws an error.
I did come across this error and added the with tf.variable_scope
line, which seemed to fix it. I'll try running again shortly to see if I can reproduce the error.
from generative-adversarial-networks.
OK, I think I've fixed the problem in gan-script.py; TF v1.0 and v1.1 might handle variable scope in slightly different ways. The code previously worked in v1.0.1 but broke in v1.1.
In the revised script, variable scope is handled at a slightly higher level; reuse_variables()
is false until after the optimizers are defined, at which point it's set to true for the rest of the script. The exception is the discriminator network, which is set up once with variable reuse off and a second time with variable reuse on.
@adeshpande3, would you mind running gan-script.py to make sure I didn't miss anything? I'll make the same changes to gan-script-fast.py now.
from generative-adversarial-networks.
I've now updated gan-script-fast.py along the same lines, and I've tested it and gan-script.py on both TF v1.0.1 and v1.1.0.
@heathervica, thanks for bringing this to our attention!
I'm going to go ahead and close this issue for now; @adeshpande3, let me know if you run into any problems when you run the files.
from generative-adversarial-networks.
Related Issues (8)
- Python 3.5 TensorFlow 1.2 variable scope related error HOT 2
- What should I do if I want to use this to train my own database HOT 2
- Training Betas and Gammas of the batch normalization HOT 3
- Not able to load pre-trained model HOT 4
- ValueError: Variable d_w1/Adam_5/ does not exist, or was not created with tf.get_variable(). Did you mean to set reuse=tf.AUTO_REUSE in VarScope? HOT 3
- why this code only in discriminator, but not in generator?: HOT 1
- Variable d_w1/Adam_3/ does not exist, or was not created with tf.get_variable(). Did you mean to set reuse=tf.AUTO_REUSE in VarScope? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from generative-adversarial-networks.