Error: Error When Checking Model Input: Expected Dense_input_6 To Have Shape (none, 784) But Got Array With Shape (784l, 1l)
I get an error when trying to apply the below code onto the MNIST sample dataset for both training and testing. Please helpe The following is my code: import pandas import numpy
Solution 1:
I assume you are working with this tutorial.
I would recommend using pandas to read your format:
import pandas as pd
import numpy as np
data = pd.read_csv('mnist_train_100.csv', header=None)
# numpy array of shape (100, 784), type float32
X_train = data.ix[:, 1:].values.astype(np.float32)
# numpy array of shape (100,), type int64
y_train = data.ix[:, 0].values
Post a Comment for "Error: Error When Checking Model Input: Expected Dense_input_6 To Have Shape (none, 784) But Got Array With Shape (784l, 1l)"