Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: setting an array element with a sequence. #23

Open
thakersamveg608 opened this issue Oct 15, 2019 · 4 comments
Open

ValueError: setting an array element with a sequence. #23

thakersamveg608 opened this issue Oct 15, 2019 · 4 comments

Comments

@thakersamveg608
Copy link

I have used your model for running Test.py and the COCO Test Dataset for images. I have chosen 25 images.
The error I am getting is :
Screenshot 2019-10-15 at 3 56 44 PM

@phoenicorn
Copy link

@thakersamveg608
remove ".astype(np.float32)".The error will be fixed

@sandhya9173
Copy link

hi
i m getting error (Error when checking input: expected input_6 to have 4 dimentions, but got array with shape(4,1))

@sirius0503
Copy link

@thakersamveg608
remove ".astype(np.float32)".The error will be fixed

When I do this I get another error:

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 34, in test_model_for_lr_images
    Utils.plot_test_generated_images(output_dir, model, x_test_lr)
  File "/home/aspiring1/.Private/Keras-SRGAN/Utils.py", line 220, in plot_test_generated_images
    image_batch_lr = denormalize(x_test_lr)
  File "/home/aspiring1/.Private/Keras-SRGAN/Utils.py", line 54, in denormalize
    return input_data.astype(np.uint8)
ValueError: setting an array element with a sequence.

And when I remove .astype(np.uint8) I get another error:

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 34, in test_model_for_lr_images
    Utils.plot_test_generated_images(output_dir, model, x_test_lr)
  File "/home/aspiring1/.Private/Keras-SRGAN/Utils.py", line 221, in plot_test_generated_images
    gen_img = generator.predict(image_batch_lr)
  File "/home/aspiring1/.virtualenvs/srgan/lib/python3.5/site-packages/keras/engine/training.py", line 1149, in predict
    x, _, _ = self._standardize_user_data(x)
  File "/home/aspiring1/.virtualenvs/srgan/lib/python3.5/site-packages/keras/engine/training.py", line 751, in _standardize_user_data
    exception_prefix='input')
  File "/home/aspiring1/.virtualenvs/srgan/lib/python3.5/site-packages/keras/engine/training_utils.py", line 128, in standardize_input_data
    'with shape ' + str(data_shape))
ValueError: Error when checking input: expected input_1 to have 4 dimensions, but got array with shape (4, 1)

@deepak112 Can you please have a look at this error, thanks I am just trying to use your model gen_model3000.h5 to evaluate some of my images.

Python command used:

python test.py --input_low_res='./inputdir/' --output_dir='./out' --model_dir='./model/gen_model3000.h5' --number_of_images=4 --test_type='test_lr_images' 

@BassantTolba1234
Copy link

Please all,
I need the code of implementation this part
the part is

{The SRResNet networks
were trained with a learning rate of 10−4 and 106 update
iterations. We employed the trained MSE-based SRResNet
network as initialization for the generator when training
the actual GAN to avoid undesired local optima.{

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

No branches or pull requests

4 participants