deepak112 / Keras-SRGAN

Photo-Realistic Single Image Super-Resolution Using a Generative Adversarial Network implemented in Keras

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ValueError: Error when checking input: expected input_12 to have 4 dimensions, but got array with shape (4, 1)

sandhya9173 opened this issue · comments

I mnot able to understand where this problem in this line its showing error(d_loss_real = discriminator.train_on_batch(image_batch_hr, real_data_Y) but my images size(shape (96, 96, 3)), can you please where its problem

pic
pic2

Both check please help in this error I mnot understanding

You still facing this issue?

@deepak112 Hi Deepak, I am facing a similar issue could you please look at this thread here, I think it is a similar issue, except @sandhya9173 is trying to train the model, whereas I am trying to evaluate your pretrained model issue

@deepak112 Hi Deepak iam facing the same issue while training, using the simplified code, in Colab

Hi,
Can you please tell me shape of x_train_lr, x_train_hr, x_test_lr, x_test_hr in your code.

thanks for prompt reply, here are the shapes:
x_train_lr = (500,)
x_train_hr = (500,)
x_test_lr = (300,)
x_test_lr = (300,)

Are all images are of same shape?

shall i use the function load_data_from_dirs_resize instead of load_data_from_dirs, to load the data?

Ya images are not of same size. Either make one custom funtion to have same size images. And then save those images to some directory and then use load_data_from_dirs.