deepak112 / Keras-SRGAN

Photo-Realistic Single Image Super-Resolution Using a Generative Adversarial Network implemented in Keras
276 stars 146 forks source link

Error running the test module #6

Closed ajinkya933 closed 5 years ago

ajinkya933 commented 5 years ago

@deepak112

I ran:

python test.py --input_low_res="data_lr/" --output_dir="output/" --model_dir="model/gen_model3000.h5" --number_of_images=1 --test_type="test_lr_images"

I am getting error:

Using TensorFlow backend.
2019-05-19 13:41:02.333970: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
Traceback (most recent call last):
  File "test.py", line 67, in <module>
    test_model_for_lr_images(values.input_low_res, model, values.number_of_images, values.output_dir)
  File "test.py", line 33, in test_model_for_lr_images
    x_test_lr = Utils.load_test_data(input_low_res, 'jpg', number_of_images)
  File "/Users/ajinkyabobade/Downloads/Keras-SRGAN-master/Utils.py", line 148, in load_test_data
    x_test_lr = normalize(x_test_lr)
  File "/Users/ajinkyabobade/Downloads/Keras-SRGAN-master/Utils.py", line 50, in normalize
    return (input_data.astype(np.float32) - 127.5)/127.5 
ValueError: setting an array element with a sequence.

How to resolve this error ?

deepak112 commented 5 years ago

How many images are you using for testing and try to check image properties and only use images with same properties. Like you need to take images if same dimensions, check numbers of channels and also all images are not of RGB format. Hope this helps.

ajinkya933 commented 5 years ago

@deepak112

I am using 25 images for testing. All images are of low resolution (96x96 pixels). All images are RGB. Should I convert them to grayscale ?