title: Layer weight shape (1, 1) not compatible with provided weight shape (1,) for keras model
body: <p>I trained a model using Keras but forgot to save the model. This model was the part of a project where many other models were developed but now I can not proceed with the project. Fortunately I saved initial and final training weights. Now, I am trying to create a model with same final weights to get the predictions. I am compiling the keras model and using function model.set_weights to set the final training weights of lost model to new model.
  Here is the code.</p>
  <pre><code>model = Sequential()
  model.add(Dense(1,input_dim = 1, activation = 'relu'))
  model.add(Dense(1, activation = 'relu'))
  model.compile(loss = 'mean_squared_error', optimizer = 'Adam', metrics = ['mse'])
  listOfNumpyArrays = [np.array([0.2]),np.array([0.2])]
  listOfNumpyArrays1 = listOfNumpyArrays
  model.layers[0].set_weights(listOfNumpyArrays)
  model.layers[1].set_weights(listOfNumpyArrays1)
  </code></pre>
  <p>Traceback</p>
  <pre><code>ValueError                                Traceback (most recent call last)
  &lt;ipython-input-31-e63437554e30&gt; in &lt;module&gt;()
  ----&gt; 1 model.layers[0].set_weights(listOfNumpyArrays)
        2 model.layers[1].set_weights(listOfNumpyArrays1)
  1 frames
  /usr/local/lib/python3.6/dist-packages/keras/engine/base_layer.py in set_weights(self, weights)
     1124                                  str(pv.shape) +
     1125                                  ' not compatible with '
  -&gt; 1126                                  'provided weight shape ' + str(w.shape))
     1127             weight_value_tuples.append((p, w))
     1128         K.batch_set_value(weight_value_tuples)
  ValueError: Layer weight shape (1, 1) not compatible with provided weight shape (1,)
  </code></pre>