davidADSP / GDL_code

The official code repository for examples in the O'Reilly book 'Generative Deep Learning'

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

03_05_vae_faces_train - ValueError: Layer decoder expects 1 input(s), but it received 3 input tensors

g0580016 opened this issue · comments

Can any one advise how. to solve. this error? I'm using the tensorflow 2.0 branch

The model summaries both for encoder and decoder match exactly what is in the book, but still the following error appears:

202 
203   if len(inputs) != len(input_spec):

--> 204 raise ValueError('Layer ' + layer_name + ' expects ' +
205 str(len(input_spec)) + ' input(s), '
206 'but it received ' + str(len(inputs)) +

ValueError: Layer decoder expects 1 input(s), but it received 3 input tensors. Inputs received: [<tf.Tensor: shape=(32, 200), dtype=float32, numpy=
array([[ 0.01030178, -0.04861269, -0.00733997, ..., 0.02568986,
-0.05239131, -0.00733766],
[-0.00127253, -0.02799501, -0.0425919 , ..., 0.00620324,
-0.0299464 , 0.00333741],
[ 0.05407003, -0.02429324, -0.05589804, ..., 0.05319941,
-0.08304264, 0.07161135],
...,
[ 0.08346704, 0.03703439, -0.06609847, ..., 0.01977376,
-0.03393014, 0.03309568],
[ 0.02445899, -0.0428034 , -0.05705589, ..., -0.00906711,
-0.02859434, 0.03962114],
[ 0.04257951, 0.03386647, -0.04515634, ..., 0.00611632,
-0.02480316, 0.01569294]], dtype=float32)>, <tf.Tensor: shape=(32, 200), dtype=float32, numpy=
array([[ 0.03206216, -0.03399059, -0.06497589, ..., -0.06765413,
-0.02737037, -0.05021207],
[-0.01540099, 0.00128875, -0.03477595, ..., -0.044988 ,
-0.01605266, -0.06183551],
[ 0.03116238, -0.00138427, -0.02849228, ..., -0.0959065 ,
-0.00479444, -0.1841418 ],
...,
[ 0.01189097, 0.05096394, -0.05592664, ..., -0.07456802,
0.04331308, -0.09650087],
[ 0.00857047, -0.04397327, -0.02537573, ..., -0.06807566,
-0.00480789, -0.0987746 ],
[ 0.00909407, 0.04387314, -0.02124518, ..., -0.06648304,
-0.03233341, -0.06416956]], dtype=float32)>, <tf.Tensor: shape=(32, 200), dtype=float32, numpy=
array([[-0.0837419 , 0.708279 , 0.25303954, ..., -0.15900922,
-1.4284643 , -0.8491993 ],
[ 0.3428696 , 0.16736755, 1.1209399 , ..., 1.8705027 ,
0.61709875, 0.17519997],
[-0.7050551 , 0.9497142 , 0.02680028, ..., -0.32644743,
-0.28019398, 0.26958627],
...,
[-1.0726163 , 0.03182559, -1.1401012 , ..., -0.71741265,
-2.19349 , 0.78879917],
[ 0.47682956, 0.8727338 , 0.7441382 , ..., -0.49163938,
-1.3995049 , 1.3208225 ],
[-1.7399087 , -0.2048182 , 0.5106129 , ..., 0.2584384 ,
0.7018325 , -0.4878068 ]], dtype=float32)>]

Hi, I also got the same error and I found the answer in a different question under the same repo: #83 (comment)

i have the same error, #83 can not work!