leleamol commented on issue #12247: 【C++】throw exception when use
MXDataIter("CSVIter") to train
URL:
https://github.com/apache/incubator-mxnet/issues/12247#issuecomment-422586882
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.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services