Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Why am I getting error "'train' is ambiguous" when trying to train this MLP?

I have the following code in my first attempt to use neural networks in opencv:

//Neural network
CvANN_MLP network;

Mat layer_sizes = Mat::zeros(1,3,CV_32S);
layer_sizes.at<int>(0,0) = data.cols;
layer_sizes.at<int>(0,1) = 163;
layer_sizes.at<int>(0,2) = NUM_LETTERS;

int method = CvANN_MLP_TrainParams::BACKPROP;
double method_param = 0.001;
int max_iter = 300;

network.train( data, dataLabels, 0, 0,
    CvANN_MLP_TrainParams(cvTermCriteria(CV_TERMCRIT_ITER,max_iter,0.01),
                          method, method_param));

data is 78 rows by 300 cols

dataLabels is 78 rows by 26 cols.

I realize my training set is way too small, I am just trying to get this to compile.

This was all adapted from the included sample letter recognizer. in the network.train call data and datalabels are both Mat objects that are filled with row vectors of binary values. I am getting an error that "'train' is ambiguious" on train. Does anyone see anything wrong with my code?

Thanks for any help!