TypeError: slice indices must be integers
<p>It gives me the following error when test_model is called:</p>

<pre><code>TypeError: slice indices must be integers or None or have an __index__ method
</code></pre>

<p>But I'm calling test_model with an integer (a particular batch). Inputtest is a list of list of floats and labeltes is a vector of ints. I'm not sure what the problem is.</p>

<pre><code>def optimize(learning_rate = 0.1,n_epochs = 1000, batch_size = 600):
    n_train_batches = len(inputt)//batch_size
    n_val_batches = len(inputsdev)//batch_size
    n_test_batches = len(inputstest)//batch_size
    rng = numpy.random.RandomState(1234)
    index = T.lscalar('index')
    x = T.ivector('x')
    y = T.ivector('y')
    classifier = Regression(x, n_in = 150, n_out = 24)
    cost = classifier.negative_log_likelihood(labelt)
    test_model = theano.function(inputs = [index], outputs =  classifier.errors(y),givens = { x: inputstest[index * batch_size:(index + 1) * batch_size], y : labeltes[index * batch_size:(index + 1) * batch_size]})
</code></pre>