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

DCRM doesn't work.. #20

Open
timegate opened this issue Feb 8, 2021 · 0 comments
Open

DCRM doesn't work.. #20

timegate opened this issue Feb 8, 2021 · 0 comments

Comments

@timegate
Copy link

timegate commented Feb 8, 2021

In outpaint.ipynb, below line gives the following error.
CONF_GENERATED_IMAGE = DCRM(GENERATED_IMAGE)
ValueError: number of input channels does not match corresponding dimension of filter, 3 != 256

I found that the shape of GENERATED_IMAGE is (None, 3, 128, 4) based on the summary but DCRM wants (None, 256, 128, 3) as an input. Could you guess what's going on please?

I only added 2 lines on top of the outpaint.ipynb, which are
import os os.environ['KERAS_BACKEND']='tensorflow'
otherwise, I get an error on the code
DCRM = build_discriminator()
TypeError: Failed to convert object of type <class 'theano.tensor.var.TensorVariable'> to Tensor. Contents: /dense_2_target. Consider casting elements to a supported type.

summary of GEN


Layer (type) Output Shape Param #

input_2 (InputLayer) (None, 256, 128, 3) 0


conv2d_6 (Conv2D) (None, 64, 128, 3) 409664


re_lu_1 (ReLU) (None, 64, 128, 3) 0


dropout_6 (Dropout) (None, 64, 128, 3) 0


instance_normalization_1 (In (None, 64, 128, 3) 2


conv2d_7 (Conv2D) (None, 128, 64, 2) 131200


re_lu_2 (ReLU) (None, 128, 64, 2) 0


dropout_7 (Dropout) (None, 128, 64, 2) 0


instance_normalization_2 (In (None, 128, 64, 2) 2


conv2d_8 (Conv2D) (None, 256, 32, 1) 524544


re_lu_3 (ReLU) (None, 256, 32, 1) 0


dropout_8 (Dropout) (None, 256, 32, 1) 0


instance_normalization_3 (In (None, 256, 32, 1) 2


conv2d_9 (Conv2D) (None, 512, 32, 1) 2097664


re_lu_4 (ReLU) (None, 512, 32, 1) 0


dropout_9 (Dropout) (None, 512, 32, 1) 0


instance_normalization_4 (In (None, 512, 32, 1) 2


conv2d_10 (Conv2D) (None, 512, 32, 1) 4194816


re_lu_5 (ReLU) (None, 512, 32, 1) 0


dropout_10 (Dropout) (None, 512, 32, 1) 0


instance_normalization_5 (In (None, 512, 32, 1) 2


conv2d_11 (Conv2D) (None, 512, 32, 1) 4194816


re_lu_6 (ReLU) (None, 512, 32, 1) 0


dropout_11 (Dropout) (None, 512, 32, 1) 0


instance_normalization_6 (In (None, 512, 32, 1) 2


conv2d_12 (Conv2D) (None, 512, 32, 1) 4194816


re_lu_7 (ReLU) (None, 512, 32, 1) 0


dropout_12 (Dropout) (None, 512, 32, 1) 0


instance_normalization_7 (In (None, 512, 32, 1) 2


conv2d_13 (Conv2D) (None, 512, 32, 1) 4194816


re_lu_8 (ReLU) (None, 512, 32, 1) 0


dropout_13 (Dropout) (None, 512, 32, 1) 0


instance_normalization_8 (In (None, 512, 32, 1) 2


conv2d_14 (Conv2D) (None, 512, 32, 1) 4194816


re_lu_9 (ReLU) (None, 512, 32, 1) 0


dropout_14 (Dropout) (None, 512, 32, 1) 0


instance_normalization_9 (In (None, 512, 32, 1) 2


conv2d_15 (Conv2D) (None, 512, 32, 1) 4194816


re_lu_10 (ReLU) (None, 512, 32, 1) 0


dropout_15 (Dropout) (None, 512, 32, 1) 0


instance_normalization_10 (I (None, 512, 32, 1) 2


conv2d_16 (Conv2D) (None, 512, 32, 1) 4194816


re_lu_11 (ReLU) (None, 512, 32, 1) 0


dropout_16 (Dropout) (None, 512, 32, 1) 0


instance_normalization_11 (I (None, 512, 32, 1) 2


conv2d_transpose_1 (Conv2DTr (None, 256, 64, 2) 2097408


re_lu_12 (ReLU) (None, 256, 64, 2) 0


conv2d_transpose_2 (Conv2DTr (None, 128, 128, 4) 524416


re_lu_13 (ReLU) (None, 128, 128, 4) 0


conv2d_17 (Conv2D) (None, 128, 128, 4) 262272


re_lu_14 (ReLU) (None, 128, 128, 4) 0


dropout_17 (Dropout) (None, 128, 128, 4) 0


instance_normalization_12 (I (None, 128, 128, 4) 2


conv2d_18 (Conv2D) (None, 64, 128, 4) 131136


re_lu_15 (ReLU) (None, 64, 128, 4) 0


dropout_18 (Dropout) (None, 64, 128, 4) 0


instance_normalization_13 (I (None, 64, 128, 4) 2


conv2d_19 (Conv2D) (None, 3, 128, 4) 3075

Total params: 35,545,117
Trainable params: 35,545,117
Non-trainable params: 0


summary of DCRM


Layer (type) Output Shape Param #

input_1 (InputLayer) (None, 256, 128, 3) 0


conv2d_1 (Conv2D) (None, 32, 64, 2) 204832


leaky_re_lu_1 (LeakyReLU) (None, 32, 64, 2) 0


dropout_1 (Dropout) (None, 32, 64, 2) 0


conv2d_2 (Conv2D) (None, 64, 32, 1) 51264


leaky_re_lu_2 (LeakyReLU) (None, 64, 32, 1) 0


dropout_2 (Dropout) (None, 64, 32, 1) 0


conv2d_3 (Conv2D) (None, 64, 16, 1) 102464


leaky_re_lu_3 (LeakyReLU) (None, 64, 16, 1) 0


dropout_3 (Dropout) (None, 64, 16, 1) 0


conv2d_4 (Conv2D) (None, 128, 8, 1) 204928


leaky_re_lu_4 (LeakyReLU) (None, 128, 8, 1) 0


dropout_4 (Dropout) (None, 128, 8, 1) 0


conv2d_5 (Conv2D) (None, 128, 4, 1) 409728


leaky_re_lu_5 (LeakyReLU) (None, 128, 4, 1) 0


dropout_5 (Dropout) (None, 128, 4, 1) 0


flatten_1 (Flatten) (None, 512) 0


dense_1 (Dense) (None, 1024) 525312


dense_2 (Dense) (None, 1) 1025

Total params: 1,499,553
Trainable params: 1,499,553
Non-trainable params: 0


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

1 participant