-
Notifications
You must be signed in to change notification settings - Fork 6.8k
【C++】throw exception when use MXDataIter("CSVIter") to train #12247
Comments
@mxnet-label-bot : [C++, Question] |
Can you please share how you are setting the parameters for the CSVIter iterator? To be precise, the implementation of "setDataIter()" used in the above code. According to https://github.com/apache/incubator-mxnet/blob/master/src/io/iter_csv.cc, for CSVIter to work correctly, the parameters such as "data_csv", "data_shape",etc are required to be set. The implementation of "setDataIter()" in the "mxnet-cpp/examples/utils.h" is specific to "MNISTIter". The function is setting the parameters (such as "image", "label", etc) that are specific to MNISTIter. |
You can try using the "CSVIter" as follows.
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. |
I think this function is part of the example, in example/utils.h Would be great is if you can try to reproduce the issue @zxy110 is facing, and either fix the example, or show how the usage is incorrect. |
@lupesko yes it does solve the issue. The example demonstrates how to use CSVIter. |
@mxnet-label-bot : [pending-requester-info] |
@leleamol Yes I've solved the problem, thank you very much! |
Hello, I want to user CSVIter in my cpp program, but I got an exception at
MXDataIterBeforeFirst(blob_ptr_->handle_);
in io.hpp
I don't know whether it's caused by the shapes I set.
I've use the mnist datasets, Here is my code.
The text was updated successfully, but these errors were encountered: