Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

InvalidArgumentError: Input to reshape is a tensor with 3200 values, but the requested shape requires a multiple of 49 [[{{node decoder/Reshape}}]] #7

Open
Alla-Abdella opened this issue Mar 9, 2019 · 5 comments

Comments

@Alla-Abdella
Copy link

No description provided.

@AdityaAmrutiya
Copy link

I am also getting the same issue

@erdalalim
Copy link

@AdityaAmrutiya @alla15747 you solve it?
Iam trying to run face creation, its prepared to generate 40x40 pixel images.. I want to generate 200x200 pixel so I change 40,40,3 values to 200,200,3 to get 200pixel images but Iam facing this error :

InvalidArgumentError: Input to reshape is a tensor with 307200 values, but the requested shape requires a multiple of 120000
[[Node: discriminator_1/Reshape = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:CPU:0"](generator/conv2d_transpose_3/Sigmoid, discriminator/Reshape/shape)]]

any suggestions,In which line I need to make correction?

@u112358
Copy link

u112358 commented Jun 28, 2019

No description provided.

change x = tf.layers.dense(x, units=inputs_decoder * 2 + 1, activation=lrelu) to x = tf.layers.dense(x, units=inputs_decoder * 2, activation=lrelu) in decoder() will solve this problem.

@erdalalim
Copy link

Hi @u112358 ,

i can't find the line x = tf.layers.dense(x, units=inputs_decoder * 2 + 1, activation=lrelu) in script (DCGAN-face-creation.ipynb), the code you mentioned is in VAE.ipynb.

i only need to change the size of the generated images from default size 40x40 to any other size example between: 100x100 or 200x200 pixels. When i tried to change the sizes i'm getting the error above. Do you have any idea how to change the sizes of images ?

thanks

@arnouri
Copy link

arnouri commented Aug 14, 2020

No description provided.

change x = tf.layers.dense(x, units=inputs_decoder * 2 + 1, activation=lrelu) to x = tf.layers.dense(x, units=inputs_decoder * 2, activation=lrelu) in decoder() will solve this problem.

This is a full year later so sorry for reviving this but I was wondering if you could provide any insight on why this fix works?
Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants