This repository was archived by the owner on Dec 29, 2022. It is now read-only.
This repository was archived by the owner on Dec 29, 2022. It is now read-only.
TypeError: Expected int32, got <prettytensor.pretty_tensor_class.Layer > of type 'Layer' instead. #48
Closed
Description
I'm trying to run the StackGAN code (https://github.com/hanzhanggit/StackGAN) using TF1.0 and prettytensor (0.7.2) and I receive the following error
"TypeError: Expected int32, got <prettytensor.pretty_tensor_class.Layer object at 0x7f396c1ea590> of type 'Layer' instead." when I run the (sh demo/birds_demo.sh).
A friend who ran the same in TF 0.12 had no problems. Is this because of TF1.0? Do you have any idea what's the problem or what can be done to overcome it?
Thank you
Activity
eiderman commentedon Feb 20, 2017
Do you have more of an error message or a line of code? This looks like it is either from changes to arg order in TF that StackGAN does not support or a registration problem for Pretty Tensor objects.
nsarafianos commentedon Feb 20, 2017
Thank you for your response. The problem occurs in line 64 of demo.py. Here's the full error message.
eiderman commentedon Feb 20, 2017
nsarafianos commentedon Feb 20, 2017
Thank you I will reach out to them.
evanfeinberg commentedon Feb 21, 2017
@nsarafianos I just ran into the same issue. Fixed it by changing the TF concat order:
https://www.tensorflow.org/install/migration
nsarafianos commentedon Feb 21, 2017
@evanfeinberg Thank you
seongkyun commentedon May 10, 2017
@evanfeinberg It works. thanks!
EruditeStranger commentedon May 24, 2017
@evanfeinberg Could you please elaborate on what exactly what needed to be changed?
nsarafianos commentedon May 24, 2017
@EruditeStranger From the TF migration page: tf.concat arguments have been reordered to tf.concat(values, axis, name='concat') whereas in line 64 of the demo it's the other way around (i.e., tf.concat(1, [c, z])). So if I remember correctly you just swap the 1 with [c,z] and you're good to go.
EruditeStranger commentedon May 24, 2017
@nsarafianos Just to be clear, were you suggesting reordering the arguments to tf.concat([c, z],1)? Because it doesn't seem to work for me.
I really apologize if this seems like a silly question; I've only just started with GANs.
EruditeStranger commentedon May 24, 2017
My apologies - it did in fact, work. This bug led me to change a whole bunch of the code that had compatibility issues with TensorFlow 1.0
Thanks a bunch, @nsarafianos @evanfeinberg!
devshakyawarrahul commentedon Jul 14, 2017
i'm facing the same issue, i already tried reordering of tf.concat but din't work out for me. please suggest something. Thanks @nsarafianos @evanfeinberg @EruditeStranger @eiderman
cw1091293482 commentedon Nov 1, 2017
@nsarafianos @EruditeStranger @seongkyun @evanfeinberg Actually it works for me after I changed the tf.concat(1, [c, z]) 【argument in TF1.0】to tf.concat([c, z],1)【argument in TF0.12】, but after changed, I am facing another issue happend in line: x_code = self.d_encode_img_template.construct(input= x_var).
the error is# ValueError: too many values to unpack.
Have you or anyone else face this issue when reproduce StackGAN, and what may be the possible solutions?
Thank you.
cw1091293482 commentedon Nov 1, 2017
It seem that he/she also faces this issue: hanzhanggit/StackGAN#27
kyle-pena-nlp commentedon Nov 2, 2017
@cw1091293482 I am facing a different issue than you are. But it is of the same root cause... the authors need to list the exact versions of the libraries they used in a requirements file so that we can replicate their buildout without modifying their code.
llewis257 commentedon Apr 18, 2018
How in details did you overcome the compatibility issues? @EruditeStranger
I have the same problem. Thanks in advance