Comments (7)
In the latest version that I try, I don't get that error. I can reproduce it if I put everything in a namescope and call it twice.
This is a limitation of how name_scopes and variable_scopes work together and is is recommended to prefer variable_scope when you are creating sub-graphs with variables (which all the layers do).
If you are using an interactive shell like jupyter, I find using an explicit graph when playing around (e.g. with tf.Graph().as_default():
) really helps cut down on interference type errors.
from prettytensor.
I think the problem was that the variable scope was not set properly in scopes.var_and_name_scope().
I applied the following change to get everything working:
diff --git a/prettytensor/scopes.py b/prettytensor/scopes.py
index 809b32a..d1a914e 100644
--- a/prettytensor/scopes.py
+++ b/prettytensor/scopes.py
@@ -69,7 +69,8 @@ def var_and_name_scope(names):
initializer=old_vs.initializer)
vs_key[0].name_scope = scope
- yield scope, vs_key[0]
+ with tf.variable_scope(vs_key[0]):
+ yield scope, vs_key[0]
finally:
vs_key[0] = old_vs
Now the variables have properly scoped names like "fully_connected/weights" instead of just "weights".
I am using TensorFlow 0.7.1
from prettytensor.
I had the same error when I rebase to 0.8.0. @fftobiwan 's fix also works for me.
from prettytensor.
Thanks for the update. It appears that a certain change has landed, so I will upload with the fix.
from prettytensor.
I've made the update -- this was related to changes in the semantics of tf.get_collection() and tf.get_collection_ref().
Please verify that it works, thanks again!
from prettytensor.
It works for me, thank you very much.
from prettytensor.
Zoe from stackOverflow said:
tf.reset_default_graph()
at the beginning of the script.
Worked for me. Thanks,
from prettytensor.
Related Issues (20)
- How to do regularization? HOT 3
- AttributeError: type object 'GraphKeys' has no attribute 'GLOBAL_VARIABLES' HOT 3
- AttributeError: module 'tensorflow' has no attribute 'complex_abs' HOT 3
- TypeError: Expected int32, got <prettytensor.pretty_tensor_class.Layer > of type 'Layer' instead. HOT 16
- weights reuse in {gru, lstm}_cell/_sequence methods HOT 2
- Bug with template, phase=Unbound and batch_normalize=True
- loading from checkpoint
- conv2d 'kernel'
- run baby_names.py error HOT 1
- PrettyTensor's template.construct() yielding ValueError HOT 2
- TypeError: slice indices must be integers or None or have an __index__ method
- using tensorboard with prettytensor
- manipulating output layer of tensorflow during learning
- how to use the dropout and l2loss ?
- Prettytensor not working with TF1.8 HOT 4
- With Tensorflow 0.12, it is throwing "TypeError: zeros_initializer() takes at least 1 argument (0 given)".
- How can i use inspect_checkpoint tool to print all the weight ?
- AttributeError: 'VariableScope' object has no attribute 'current_scope HOT 2
- AttributeError: module 'tensorflow' has no attribute 'GraphKeys'. In python while importing tflearn. HOT 2
- c++
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 prettytensor.