# Sd.evaluate failure

**URL:** <https://community.konduit.ai/t/sd-evaluate-failure/2784>\
**Category:** SameDiff\
**Created:** [August 20, 2023, 8:05pm UTC](https://community.konduit.ai/t/sd-evaluate-failure/2784 "2023-08-20T20:05:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![adonnini](https://avatars.discourse-cdn.com/v4/letter/a/5f8ce5/32.png) [@adonnini](https://community.konduit.ai/u/adonnini)\
**Post date:** [August 20, 2023, 8:05pm UTC](https://community.konduit.ai/t/sd-evaluate-failure/2784/1 "2023-08-20T20:05:46Z")

</div>

When I run the code reported below, execution fails with

`Index can't be < 0 and >= 1984`

`outReduced` has shape `[64, 2, 31]`

`testData` has 109 elements.

What am I missing / doing wrong?

Thanks

CODE

```java
                String outputVariable = outReduced.name();

                evaluation = new Evaluation();

                testData.reset();
                sd.evaluate(testData, outputVariable, evaluation);

```

ERROR LOG

```java
Exception in thread "main" java.lang.IllegalStateException: Index can't be < 0 and >= 1984
	at org.nd4j.linalg.factory.Nd4j.pullRows(Nd4j.java:4749)
	at org.nd4j.linalg.factory.Nd4j.pullRows(Nd4j.java:4722)
	at org.nd4j.evaluation.EvaluationUtils.extractNonMaskedTimeSteps(EvaluationUtils.java:208)
	at org.nd4j.evaluation.BaseEvaluation.reshapeAndExtractNotMasked(BaseEvaluation.java:186)
	at org.nd4j.evaluation.classification.Evaluation.eval(Evaluation.java:361)
	at org.nd4j.evaluation.BaseEvaluation.eval(BaseEvaluation.java:267)
	at org.nd4j.autodiff.samediff.SameDiff.evaluateHelper(SameDiff.java:2402)
	at org.nd4j.autodiff.samediff.SameDiff.evaluate(SameDiff.java:2296)
	at org.nd4j.autodiff.samediff.config.EvaluationConfig.exec(EvaluationConfig.java:197)
	at org.nd4j.autodiff.samediff.SameDiff.evaluate(SameDiff.java:2206)
	at org.deeplearning4j.examples.trajectorypredictiontransformer.LocationNextNeuralNetworkV7_04.fitAndEvaluateTestDataset(LocationNextNeuralNetworkV7_04.java:1083)
	at org.deeplearning4j.examples.trajectorypredictiontransformer.LocationNextNeuralNetworkV7_04.sameDiff3(LocationNextNeuralNetworkV7_04.java:685)
	at org.deeplearning4j.examples.trajectorypredictiontransformer.LocationNextNeuralNetworkV7_04.main(LocationNextNeuralNetworkV7_04.java:207)

```
