Python model predict value error when omission occurs

Viewed 103

I'm using Keras to predict values, however when an omission is detected in the dataset I get a ValueError that I don't understand. I'm sending data continuously to a server that then predicts the next value. This is the part of the code where I predict the value:

for i in range(len(models)):
    path = models[i]['path']
    model = models[i]['model']
    inpt = to_input[i]
    p = model.predict((inpt,))[0][0]
    predictions.append((path, ann_type[i], p, target_time))

I've tried to convert inpt to np.asarray but the code seams to work perfectly as is when there's no omissions in the dataset.

This is the error I get:

ValueError: Failed to find data adapter that can handle input: (<class 'tuple'> containing values of types {'(<class \'list\'> containing values of types {"<class \'numpy.float32\'>", "<class \'float\'>"})'}), <class 'NoneType'>

And this is the inpt variable when the error occurs:

[23.852264, 25.759071, 22.86, 25.736681, 22.71, 22.97, 23.25, 23.23, 23.4, 23.1]

I don't see anything unusual but I can't seem to resolve this error.

0 Answers
Related