Keras-SRGAN icon indicating copy to clipboard operation
Keras-SRGAN copied to clipboard

Model is not working for different dataset

Open sanahtech opened this issue 5 years ago • 2 comments

SRGAN model is working fine for given DIV2K_train_hr dataset. But I tried to train the same model for a different dataset. It does not work.

following is the error. File "init.py", line 83, in train(FLAGS) File "/home/student/usama_lahore/Memona/perceptual-reflection-removal-master/SRGANmodelnewdata/SRGAN-Keras-Implementation-master/train.py", line 21, in train srgan_model.train(epochs, save_interval = save_interval, batch_size = batch_size) File "/home/student/usama_lahore/Memona/perceptual-reflection-removal-master/SRGANmodelnewdata/SRGAN-Keras-Implementation-master/models/SRGAN.py", line 225, in train real_dis_loss = self.discriminator.train_on_batch(hr_imgs, real) File "/usr/local/lib/python3.5/dist-packages/keras/engine/training.py", line 1211, in train_on_batch class_weight=class_weight) File "/usr/local/lib/python3.5/dist-packages/keras/engine/training.py", line 751, in _standardize_user_data exception_prefix='input') File "/usr/local/lib/python3.5/dist-packages/keras/engine/training_utils.py", line 128, in standardize_input_data 'with shape ' + str(data_shape)) ValueError: Error when checking input: expected input_3 to have 4 dimensions, but got array with shape (16, 1)

sanahtech avatar Sep 11 '19 14:09 sanahtech

I have trained new GANs using this repo with a folder of images. How is the shape of your data (16,1)? Could you give more info on the experiment you are doing?

mrciolino avatar Sep 11 '19 16:09 mrciolino

norm_hr = self.high_reso_imgs[indx_high] / 127.5 - 1 print(norm_hr.shape)

in gen_pipeline(self, batch_size=16) function the above line prints (16, ). while it should print (16,256,256,3)

sanahtech avatar Sep 11 '19 17:09 sanahtech