I am trying to predict()
the output for a single data point d
, using my trained Keras model loaded from a file. But I get a ValueError If predicting from data tensors, you should specify the 'step' argument.
What does that mean?
I tried setting step=1
, but then I get a different error ValueError: Cannot feed value of shape () for Tensor u'input_1:0', which has shape '(?, 600)'
.
Here is my code:
d = np.concatenate((hidden[p[i]], hidden[x[i]])).resize((1,600))
hidden[p[i]] = autoencoder.predict(d,steps=)
The model is expecting (?,600)
as input. I have concatenated two numpy
arrays of shape (300,)
each to get (600,)
, which is resized to (1,600)
. This (1,600)
is my input to predict()
.
In my case, the input to predict was None
(because I had a bug in another part of the code).
-> Define value of steps argument,
d = np.concatenate((hidden[p[i]],
hidden[x[i]])).resize((1,600))
hidden[p[i]] = autoencoder.predict(d,steps=1)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With