OpenCV 3.1 ANN predict returns nan

前端 未结 1 1216
长情又很酷
长情又很酷 2021-01-03 14:35

I am trying to implement Neural network with OpenCV ANN Library. I had a working solution, but after upgrading to OpenCV 3.1 it stopped working. So I created a simplified co

相关标签:
1条回答
  • 2021-01-03 15:20

    OK, after a while of trying possible combinations I found a solution.

    Activation function must be set after setting layer sizes. I dont know exactly why, but when I flip rows like this

    nn->setLayerSizes(layers);
    nn->setActivationFunction(cv::ml::ANN_MLP::SIGMOID_SYM);
    

    its working. If someone knows the reason of this, please tell me.

    0 讨论(0)
提交回复
热议问题