You can try using the "CSVIter" as follows.
> auto train_iter = MXDataIter("CSVIter")
> .SetParam("data_csv", "./data/mnist_iter_train_data.csv")
> .SetParam("data_shape", Shape(784,1))
> .SetParam("label_csv", "./data/mnist_iter_train_label.csv")
> .SetParam("label_shape", Shape(1,1))
> .SetParam("batch_size", batch_size)
> .SetParam("flat", 1)
> .SetParam("shuffle",1)
> .CreateDataIter();
> auto val_iter = MXDataIter("CSVIter")
> .SetParam("data_csv", "./data/mnist_iter_test_data.csv")
> .SetParam("data_shape", Shape(784, 1))
> .SetParam("label_csv", "./data/mnist_iter_test_label.csv")
> .SetParam("label_shape", Shape(1,1))
> .SetParam("batch_size", batch_size)
> .SetParam("flat", 1)
> .SetParam("shuffle",1)
> .CreateDataIter();
>
In the above example "mnist_iter_train_data.csv" and "mnist_iter_test_data.csv"
files contain the input features as 784 columns and
"mnist_iter_train_label.csv", "mnist_iter_test_label.csv" as single column of
labels.
[ Full content available at:
https://github.com/apache/incubator-mxnet/issues/12247 ]
This message was relayed via gitbox.apache.org for [email protected]