Comments (15)
Try adding the below line before ema.apply in ops.py
with tf.variable_scope(tf.get_variable_scope(), reuse=tf.AUTO_REUSE):
This resolved this error for me.
from text-to-image.
i use with tf.variable_scope(self.name,reuse=tf.AUTO_REUSE) as scope: in ops.py. but an occured like this
WARNING:tensorflow:From /home/hp/anaconda3/lib/python3.7/site-packages/tensorflow/python/framework/op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.
Instructions for updating:
Colocations handled automatically by placer.
Traceback (most recent call last):
File "train.py", line 238, in
main()
File "train.py", line 76, in main
input_tensors, variables, loss, outputs, checks = gan.build_model()
File "/home/hp/Gan_project_main/text_image_gan/model.py", line 43, in build_model
g_loss = tf.reduce_mean(tf.nn.sigmoid_cross_entropy_with_logits(disc_fake_image_logits, tf.ones_like(disc_fake_image)))
File "/home/hp/anaconda3/lib/python3.7/site-packages/tensorflow/python/ops/nn_impl.py", line 157, in sigmoid_cross_entropy_with_logits
labels, logits)
File "/home/hp/anaconda3/lib/python3.7/site-packages/tensorflow/python/ops/nn_ops.py", line 2315, in _ensure_xent_args
"named arguments (labels=..., logits=..., ...)" % name)
ValueError: Only call sigmoid_cross_entropy_with_logits
with named arguments (labels=..., logits=..., ...)
how can i solve this pls reply as soon as possible
from text-to-image.
I am struggling with the same error, is there any fix?
from text-to-image.
I'm using TensorFlow v0.12. This works for me:
add with tf.variable_scope(tf.get_variable_scope(), reuse=False):
before ema.apply
from text-to-image.
where should with tf.variable_scope(tf.get_variable_scope(), reuse=tf.AUTO_REUSE): add?
before ema_apply_op = self.ema.apply([batch_mean, batch_var])?
but it does not work. @ravindra82
from text-to-image.
i use with tf.variable_scope(tf.get_variable_scope(), reuse=False): replace with tf.variable_scope(self.name,reuse=tf.AUTO_REUSE) as scope: in ops.py.
but i get ValueError: Trying to share variable beta, but specified shape (256,) and found shape (512,).
what is wrong?
from text-to-image.
i use with tf.variable_scope(tf.get_variable_scope(), reuse=False): replace with tf.variable_scope(self.name,reuse=tf.AUTO_REUSE) as scope: in ops.py.
but i get ValueError: Trying to share variable beta, but specified shape (256,) and found shape (512,).
what is wrong? @ravindra82
from text-to-image.
@gentlebreeze1 did you find solution ? because i have the same problem.
from text-to-image.
@remyavijeesh22
Use g_loss = tf.reduce_mean(tf.nn.sigmoid_cross_entropy_with_logits(logits = disc_fake_image_logits, labels = tf.ones_like(disc_fake_image)))
instead of g_loss = tf.reduce_mean(tf.nn.sigmoid_cross_entropy_with_logits(disc_fake_image_logits, tf.ones_like(disc_fake_image)))
from text-to-image.
@remyavijeesh22
Useg_loss = tf.reduce_mean(tf.nn.sigmoid_cross_entropy_with_logits(logits = disc_fake_image_logits, labels = tf.ones_like(disc_fake_image)))
instead ofg_loss = tf.reduce_mean(tf.nn.sigmoid_cross_entropy_with_logits(disc_fake_image_logits, tf.ones_like(disc_fake_image)))
I changed that. The error then goes on to show that
d_loss1
bla bla bla, so I added logits=
and labels=
the same style in g_loss
. I made changes for d_loss2
and d_loss3
as well.
When I run $ python2 generate_images.py --model_path=Data/Models/latest_model_flowers_temp.ckpt --n_images=8
Another error
Tensor name "d_bn1_1/moments/Squeeze/ExponentialMovingAverage" not found in checkpoint files Data/Models/latest_model_flowers_temp.ckpt
[[node save/RestoreV2 (defined at generate_images.py:66) ]]
Any suggestion?
from text-to-image.
I tried all of the above.
Then you will see the following error.
Could be please suggest a fix for this?
===================================================================Traceback (most recent call last):
File "train.py", line 238, in
main()
File "train.py", line 78, in main
d_optim = tf.train.AdamOptimizer(args.learning_rate, beta1 = args.beta1).minimize(loss['d_loss'], var_list=variables['d_vars'])
File "C:\Users\c0116\Anaconda3\envs\py36\lib\site-packages\tensorflow\python\training\optimizer.py", line 413, in minimize
name=name)
File "C:\Users\c0116\Anaconda3\envs\py36\lib\site-packages\tensorflow\python\training\optimizer.py", line 597, in apply_gradients
self._create_slots(var_list)
File "C:\Users\c0116\Anaconda3\envs\py36\lib\site-packages\tensorflow\python\training\adam.py", line 131, in _create_slots
self._zeros_slot(v, "m", self._name)
File "C:\Users\c0116\Anaconda3\envs\py36\lib\site-packages\tensorflow\python\training\optimizer.py", line 1155, in _zeros_slot
new_slot_variable = slot_creator.create_zeros_slot(var, op_name)
File "C:\Users\c0116\Anaconda3\envs\py36\lib\site-packages\tensorflow\python\training\slot_creator.py", line 190, in create_zeros_slot
colocate_with_primary=colocate_with_primary)
File "C:\Users\c0116\Anaconda3\envs\py36\lib\site-packages\tensorflow\python\training\slot_creator.py", line 164, in create_slot_with_initializer
dtype)
File "C:\Users\c0116\Anaconda3\envs\py36\lib\site-packages\tensorflow\python\training\slot_creator.py", line 74, in _create_slot_var
validate_shape=validate_shape)
File "C:\Users\c0116\Anaconda3\envs\py36\lib\site-packages\tensorflow\python\ops\variable_scope.py", line 1496, in get_variable
aggregation=aggregation)
File "C:\Users\c0116\Anaconda3\envs\py36\lib\site-packages\tensorflow\python\ops\variable_scope.py", line 1239, in get_variable
aggregation=aggregation)
File "C:\Users\c0116\Anaconda3\envs\py36\lib\site-packages\tensorflow\python\ops\variable_scope.py", line 562, in get_variable
aggregation=aggregation)
File "C:\Users\c0116\Anaconda3\envs\py36\lib\site-packages\tensorflow\python\ops\variable_scope.py", line 514, in _true_getter
aggregation=aggregation)
File "C:\Users\c0116\Anaconda3\envs\py36\lib\site-packages\tensorflow\python\ops\variable_scope.py", line 882, in _get_single_variable
"reuse=tf.AUTO_REUSE in VarScope?" % name)
ValueError: Variable d_h0_conv/w/Adam/ does not exist, or was not created with tf.get_variable(). Did you mean to set reuse=tf.AUTO_REUSE in VarScope?
from text-to-image.
I tried all of the above.
Then you will see the following error.
Could be please suggest a fix for this?===================================================================Traceback (most recent call last):
File "train.py", line 238, in
main()
File "train.py", line 78, in main
d_optim = tf.train.AdamOptimizer(args.learning_rate, beta1 = args.beta1).minimize(loss['d_loss'], var_list=variables['d_vars'])
File "C:\Users\c0116\Anaconda3\envs\py36\lib\site-packages\tensorflow\python\training\optimizer.py", line 413, in minimize
name=name)
File "C:\Users\c0116\Anaconda3\envs\py36\lib\site-packages\tensorflow\python\training\optimizer.py", line 597, in apply_gradients
self._create_slots(var_list)
File "C:\Users\c0116\Anaconda3\envs\py36\lib\site-packages\tensorflow\python\training\adam.py", line 131, in _create_slots
self._zeros_slot(v, "m", self._name)
File "C:\Users\c0116\Anaconda3\envs\py36\lib\site-packages\tensorflow\python\training\optimizer.py", line 1155, in _zeros_slot
new_slot_variable = slot_creator.create_zeros_slot(var, op_name)
File "C:\Users\c0116\Anaconda3\envs\py36\lib\site-packages\tensorflow\python\training\slot_creator.py", line 190, in create_zeros_slot
colocate_with_primary=colocate_with_primary)
File "C:\Users\c0116\Anaconda3\envs\py36\lib\site-packages\tensorflow\python\training\slot_creator.py", line 164, in create_slot_with_initializer
dtype)
File "C:\Users\c0116\Anaconda3\envs\py36\lib\site-packages\tensorflow\python\training\slot_creator.py", line 74, in _create_slot_var
validate_shape=validate_shape)
File "C:\Users\c0116\Anaconda3\envs\py36\lib\site-packages\tensorflow\python\ops\variable_scope.py", line 1496, in get_variable
aggregation=aggregation)
File "C:\Users\c0116\Anaconda3\envs\py36\lib\site-packages\tensorflow\python\ops\variable_scope.py", line 1239, in get_variable
aggregation=aggregation)
File "C:\Users\c0116\Anaconda3\envs\py36\lib\site-packages\tensorflow\python\ops\variable_scope.py", line 562, in get_variable
aggregation=aggregation)
File "C:\Users\c0116\Anaconda3\envs\py36\lib\site-packages\tensorflow\python\ops\variable_scope.py", line 514, in _true_getter
aggregation=aggregation)
File "C:\Users\c0116\Anaconda3\envs\py36\lib\site-packages\tensorflow\python\ops\variable_scope.py", line 882, in _get_single_variable
"reuse=tf.AUTO_REUSE in VarScope?" % name)
ValueError: Variable d_h0_conv/w/Adam/ does not exist, or was not created with tf.get_variable(). Did you mean to set reuse=tf.AUTO_REUSE in VarScope?
did you solve this problem? i also meet the same error that i have no way to solve it, can you give me some suggestion?
from text-to-image.
@remyavijeesh22
Useg_loss = tf.reduce_mean(tf.nn.sigmoid_cross_entropy_with_logits(logits = disc_fake_image_logits, labels = tf.ones_like(disc_fake_image)))
instead ofg_loss = tf.reduce_mean(tf.nn.sigmoid_cross_entropy_with_logits(disc_fake_image_logits, tf.ones_like(disc_fake_image)))
I changed that. The error then goes on to show that
d_loss1
bla bla bla, so I addedlogits=
andlabels=
the same style ing_loss
. I made changes ford_loss2
andd_loss3
as well.When I run
$ python2 generate_images.py --model_path=Data/Models/latest_model_flowers_temp.ckpt --n_images=8
Another error
Tensor name "d_bn1_1/moments/Squeeze/ExponentialMovingAverage" not found in checkpoint files Data/Models/latest_model_flowers_temp.ckpt [[node save/RestoreV2 (defined at generate_images.py:66) ]]
Any suggestion?
hello,have you solved this problem?
from text-to-image.
@remyavijeesh22
Useg_loss = tf.reduce_mean(tf.nn.sigmoid_cross_entropy_with_logits(logits = disc_fake_image_logits, labels = tf.ones_like(disc_fake_image)))
instead ofg_loss = tf.reduce_mean(tf.nn.sigmoid_cross_entropy_with_logits(disc_fake_image_logits, tf.ones_like(disc_fake_image)))
I changed that. The error then goes on to show that
d_loss1
bla bla bla, so I addedlogits=
andlabels=
the same style ing_loss
. I made changes ford_loss2
andd_loss3
as well.
When I run$ python2 generate_images.py --model_path=Data/Models/latest_model_flowers_temp.ckpt --n_images=8
Another errorTensor name "d_bn1_1/moments/Squeeze/ExponentialMovingAverage" not found in checkpoint files Data/Models/latest_model_flowers_temp.ckpt [[node save/RestoreV2 (defined at generate_images.py:66) ]]
Any suggestion?
hello,have you solved this problem?
hey were you able to fix this?
from text-to-image.
same problem T_T
from text-to-image.
Related Issues (20)
- Tensorflow error HOT 1
- Restoring from checkpoint failed. This is most likely due to a Variable name or other graph key that is missing from the checkpoint. HOT 5
- Same error while generating as well as training HOT 3
- From merging shape 0 with other shapes. for 'h3_concat/concat_dim' (op: 'Pack') with input shapes: [8,4,4,512], [8,4,4,256]. HOT 4
- Pretrained Model HOT 1
- Model wasn't saved corre
- TF error reuirements
- No such file or directory: 'Data/meta_train.pkl'
- data_loader.py
- generate_thought_vectors.py HOT 2
- From merging shape 0 with other shapes. for 'concat/concat_dim' (op: 'Pack') with input shapes: [64,100], [64,256] HOT 2
- ValueError: Tensor("moments/moments_1/mean:0", shape=(512,), dtype=float32) must be from the same graph as Tensor("g_bn0/g_bn0/moments/moments_1/mean/ExponentialMovingAverage:0", shape=(512,), dtype=float32_ref).
- No such file or directory: 'Data/skipthoughts/uni_skip.npz.pkl' HOT 1
- pickle error HOT 9
- Data Loader HOT 1
- generating images error HOT 1
- DataLossError (see above for traceback): Unable to open table file Data\Models: Unknown: NewRandomAccessFile failed to Create/Open: Data\Models : Access is denied.
- Did you mean to set reuse=tf.AUTO_REUSE in VarScope?
- Erorr for bi_skip.npz and uni_skip.npz => BadZipFile: File is not a zip file HOT 2
- how much time does dataloader.py take
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 text-to-image.