StyleGAN-Keras icon indicating copy to clipboard operation
StyleGAN-Keras copied to clipboard

Google Colab Error: ValueError: Layer model_2 expects 9 inputs, but it received 3 input tensors.

Open ddengster opened this issue 5 years ago • 4 comments

Hi, I tried setting the project up in google colab, but I'm getting the error as mentioned. Are any of you getting the same error on a local machine?

<ipython-input-16-cdeedf397bcc> in load(self, num)
    485 
    486         self.generator = self.GAN.generator()
--> 487         self.DisModel = self.GAN.DisModel()
    488         self.AdModel = self.GAN.AdModel()
    489 

<ipython-input-16-cdeedf397bcc> in DisModel(self)
    297         gi2 = Input(shape = [im_size, im_size, 1])
    298         gi3 = Input(shape = [1])
--> 299         gf = self.G([gi, gi2, gi3])
    300         df = self.D(gf)
    301 

/usr/local/lib/python3.6/dist-packages/keras/engine/base_layer.py in __call__(self, inputs, **kwargs)
    438             # Raise exceptions in case the input is not compatible
    439             # with the input_spec set at build time.
--> 440             self.assert_input_compatibility(inputs)
    441 
    442             # Handle mask propagation.

/usr/local/lib/python3.6/dist-packages/keras/engine/base_layer.py in assert_input_compatibility(self, inputs)
    297                              'but it received ' + str(len(inputs)) +
    298                              ' input tensors. Input received: ' +
--> 299                              str(inputs))
    300         for input_index, (x, spec) in enumerate(zip(inputs, input_spec)):
    301             if spec is None:

ValueError: Layer model_2 expects 9 inputs, but it received 3 input tensors. Input received: [<tf.Tensor 'input_88:0' shape=(?, 512) dtype=float32>, <tf.Tensor 'input_89:0' shape=(?, 256, 256, 1) dtype=float32>, <tf.Tensor 'input_90:0' shape=(?, 1) dtype=float32>]

ddengster avatar Jun 15 '19 16:06 ddengster

I get the same error.. @manicman1999 Can you tell me your environment?(ex. keras version .. etc)

pinest94 avatar Sep 24 '19 01:09 pinest94

Did anyone find the solution to this?

rishabhshah13 avatar Nov 27 '19 08:11 rishabhshah13

Any update for this question, i have a similar error:

Kosisochi avatar Apr 04 '20 23:04 Kosisochi

I have the same problem. any updates?

mohamedabdallah1996 avatar Dec 20 '20 11:12 mohamedabdallah1996