title: ValueError: object __array__ method not producing an array
body: <p>Trying to run a code from the link below:
  <a href="https://machinelearningmastery.com/how-to-use-the-timeseriesgenerator-for-time-series-forecasting-in-keras/" rel="nofollow noreferrer">https://machinelearningmastery.com/how-to-use-the-timeseriesgenerator-for-time-series-forecasting-in-keras/</a>
  Getting Error:     ValueError: object <strong>array</strong> method not producing an array</p>
  
  <p>Version of keras: 2.3.0-tf</p>
  
  <p>Kindly help. Thanks!</p>
  
  <pre class="lang-py prettyprint-override"><code># univariate one step problem with mlp
  from numpy import array
  from keras.models import Sequential
  from keras.layers import Dense
  from keras.preprocessing.sequence import TimeseriesGenerator
  # define dataset
  series = array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
  # define generator
  n_input = 2
  generator = TimeseriesGenerator(series, series, length=n_input, batch_size=8)
  # define model
  model = Sequential()
  model.add(Dense(100, activation='relu', input_dim=n_input))
  model.add(Dense(1))
  model.compile(optimizer='adam', loss='mse')
  # fit model
  model.fit_generator(generator, steps_per_epoch=1, epochs=200, verbose=0)
  # make a one step prediction out of sample
  x_input = array([9, 10]).reshape((1, n_input))
  yhat = model.predict(x_input, verbose=0)
  print(yhat)
  </code></pre>
  
  <p><strong>Error</strong>:</p>
  
  <pre><code>ValueError                                Traceback (most recent call last)
      &lt;ipython-input-8-550aa8802f57&gt; in &lt;module&gt;()
           11 # define model
           12 model = Sequential()
      ---&gt; 13 model.add(Dense(100, activation='relu', input_dim=n_input))
           14 model.add(Dense(1))
           15 model.compile(optimizer='adam', loss='mse')
  -----------------
     ~\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\constant_op.py in convert_to_eager_tensor(value, ctx, dtype)
           94       dtype = dtypes.as_dtype(dtype).as_datatype_enum
           95   ctx.ensure_initialized()
      ---&gt; 96   return ops.EagerTensor(value, ctx.device_name, dtype)
           97 
           98 
  
      ValueError: object __array__ method not producing an array
  </code></pre>