I apologize if this question is too elementary for this site. I am new in learning Keras and Tensorflow and I have the following type/shape problem on which I have already wasted too much time.
I entered this code (found on the web) to construct a keras model using sequential()
from keras.models import Sequential from keras.layers import Dense, Activation model = Sequential() model.add(Dense(32, activation='relu', input_dim=100)) model.add(Dense(1, activation='sigmoid')) model.compile(optimizer='rmsprop', loss='binary_crossentropy', metrics=['accuracy'])
I then want to try the function model.evaluate(). But I can't find in the documentation nor in my trials and errors under what format the entry of evaluate should be. Among many other things, I have tried:
import numpy as np model.evaluate(np.random.random((100,)))
but I get a long error message ending in
ValueError: Error when checking input: expected dense_1_input to have shape (100,) but got array with shape (1,)
Anyone has an idea what is happening here? Just a simple line of code creating a dummy entry that my model could evaluate() would unstuck me, I think.