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

Concatenate #16

Closed
MinuteswithMetrics opened this issue Mar 8, 2018 · 8 comments
Closed

Concatenate #16

MinuteswithMetrics opened this issue Mar 8, 2018 · 8 comments

Comments

@MinuteswithMetrics
Copy link

I got the following error when I tried to apply the code to my own data set:

ValueError: A Concatenate layer requires inputs with matching shapes except for the concat axis. Got inputs shapes: [(None, 64, 64, 128), (None, 63, 63, 128)]

Any assistance will be greatly appreciated.

@famishedrover
Copy link

Try resizing the input images to same size - as in the paper / implementation here.

The problem can be, when you downsample from say image of size (5,5) to half , you get (2,2) and upsampling it gives (4,4) , hence the error.

@eriklindernoren
Copy link
Owner

@MinuteswithMetrics could you further explain your setup? As in what are the dimensions of your images? What GAN implementation are you trying to train? And on what line do you get this error?

@MinuteswithMetrics
Copy link
Author

MinuteswithMetrics commented Mar 31, 2018 via email

@eriklindernoren
Copy link
Owner

How are you using the mask? If you follow the folder structure I use for CycleGAN and pix2pix (i.e. the ones that are created by using the download scripts for both models) and use the data loaders that I have implemented it should work.

@MinuteswithMetrics
Copy link
Author

MinuteswithMetrics commented Mar 31, 2018 via email

@eriklindernoren
Copy link
Owner

So if you want the model to condition its prediction on the mask then you will need to scale both the mask and the images to the same dimensions, and also the same number of channels. The data loader for pix2pix assumes that the images are concatenated by width (like this https://raw.githubusercontent.com/affinelayer/pix2pix-tensorflow/master/docs/ab.png), where the image you want to condition on is positioned on the right and the image you would like the model to produce is on the left. If you arrange your images like this you should be able to use the data loader for pix2pix.

@MinuteswithMetrics
Copy link
Author

MinuteswithMetrics commented Mar 31, 2018 via email

@DonaldAlan
Copy link

I notice that if I resize images to a power of 2, such as 128, it works. But if I try 200, I get the same error A Concatenate layer requires inputs with matching shapes except for the concat axis. Got inputs shapes:.

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