Did anyone got this error: in neural_stype.ipynb

Hi,
I am getting this matrix dimension error in neural_style.ipynb and not sure same code that worked for the class not working for me: btw, I am using tensorflow as keras backend and keras version 1.2.

content_model = Model(model.input, content_layer)
content_targ = K.variable(content_model.predict(src))

ValueError Traceback (most recent call last)
in ()
1 content_model = Model(model.input, content_layer)
----> 2 content_targ = K.variable(content_model.predict(src))

~/anaconda2/envs/dl4nlp/lib/python3.5/site-packages/keras/engine/training.py in predict(self, x, batch_size, verbose)
1199 x = standardize_input_data(x, self.input_names,
1200 self.internal_input_shapes,
-> 1201 check_batch_dim=False)
1202 if self.stateful:
1203 if x[0].shape[0] > batch_size and x[0].shape[0] % batch_size != 0:

~/anaconda2/envs/dl4nlp/lib/python3.5/site-packages/keras/engine/training.py in standardize_input_data(data, names, shapes, check_batch_dim, exception_prefix)
111 ’ to have shape ’ + str(shapes[i]) +
112 ’ but got array with shape ’ +
–> 113 str(array.shape))
114 return arrays
115

ValueError: Error when checking : expected input_2 to have shape (None, 336, 598, 3) but got array with shape (1, 336, 500, 3)

1 Like