simontomaskarlsson / CycleGAN-Keras

Keras implementation of CycleGAN using a tensorflow backend.
GNU General Public License v3.0
193 stars 61 forks source link

Error with Dimention #27

Open HeoJinLareine opened 5 years ago

HeoJinLareine commented 5 years ago

Just after running, I got an error.

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

My own dataset has 120 training, 4 test 256x256x3 jpg files.

Can I figure it out how to fix it?

kpagels commented 5 years ago

Just after running, I got an error.

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

My own dataset has 120 training, 4 test 256x256x3 jpg files.

Can I figure it out how to fix it?

The error says it is expecting the input to have 4 dimensions. This makes sense. So your training dataset should have shape (120,256,256,1) and test should have shape (1,256,256,1). And if your channel is 3 the last digit should be 3.

What shape is your image when loading it? And can you link the code?

HeoJinLareine commented 5 years ago

Thanks for such fast answer!

It did fixed after I change 'init' image_shape as (256,256,4). But I got other error with testing... [Errno 2] No such file or directory: 'generate_images/synthetic_images/A/3.j_synthetic.png'

I did exactly as you say in readme in generate_images.

kpagels commented 5 years ago

This is where @simontomaskarlsson has to help you. I did not use that method in my implementation. I implemented my own to customize it to my own project.

simontomaskarlsson commented 5 years ago

Thank you for the assistance @kpagels!

Are there any translated synthetic images in any of your new folders generated_images/synthetic_images/A or generated_images/synthetic_images/B @HeoJinLareine?

vkunder commented 4 years ago

'ValueError: Error when checking input: expected input_5 to have 4 dimensions, but got array with shape (1, 1)'
I am getting this error in 'synthetic_images_B = self.G_A2B.predict(real_images_A)' this line while training given input shape as (256,256,3) can anyone help me on this please?