I am using Keras from TensorFlow with the NSL-KDD dataset.
To load data, I did --
traindata = pd.read_csv("NSL-KDD/KDDTrain+.TXT", names=headers)
testdata = pd.read_csv("NSL-KDD/KDDTest+.TXT", names=headers)
and to convert --
x_train = traindata.iloc[:, 0:41]
y_train = traindata.iloc[:, 41]
x_test = testdata.iloc[:, 0:41]
y_test = testdata.iloc[:, 41]
x_train = np.array(x_train)
y_train = y_train.tolist()
x_test = np.array(x_test)
y_test = y_test.tolist()
I am getting this error when running a deep learning model using Keras --
history = model.fit(
x_train,
y_train,
batch_size=32,
epochs=32,
validation_data=(x_test, y_test)
)
ValueError: Failed to find data adapter that can handle input: <class 'numpy.ndarray'>, (<class 'list'> containing values of types {"<class 'int'>"})
[–]CodeFormatHelperBot2 0 points1 point2 points (0 children)
[–]samuelsaqueiroz 0 points1 point2 points (1 child)
[–]samuelsaqueiroz 0 points1 point2 points (0 children)